ElearnSAS.com

ElearnSAS.com
SAS Learning Platform

Base SAS 11

The contents of the raw data file CALENDAR are listed below:
--------10-------20-------30
01012000
The following SAS program is submitted:
data test;
infile 'calendar';
input @1 date mmddyy10.;
if date = '01012000'd then event = 'January 1st';
run;
Which one of the following is the value of the EVENT variable?
A. 01012000
B. January 1st
C. . (missing numeric value)
D. The value can not be determined as the program fails to execute due to errors.Click Comment link to get answer

60 comments:

  1. Anonymous1:05 AM

    The answer is D

    ReplyDelete
  2. Answer is D, will not execute because of errors.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Anonymous12:55 AM

    Answer D is becaues date constant is invalid. [Evern after providing correct date constant -date='01JAN2000'd desired output not produced and it produces Note: SAS went to a new line when INPUT statement reached past the end of a line.]

    ReplyDelete
  5. Shiva,

    The error thats shown even on your correction is probably because the informat given is wrong. The informat should be 'mmddyy8.'. Once u do that, the event shows up as January 1st

    ReplyDelete
  6. Answer is D. If we provide correct date contant date='01jan2000'd, will get the result.
    please try the below program.

    data test;
    infile datalines;
    input @1 date mmddyy10.;
    if date = '01jan2000'd then event = 'January 1st';
    datalines;
    01012000
    ;

    ReplyDelete
  7. Anonymous11:57 AM

    sweta....try i twith date='01012000' and still u get the result , tha answer should be b

    ReplyDelete
  8. Anonymous4:03 PM

    The answer should be B. try this program:

    data test;
    infile datalines;
    input @1 date mmddyy8.;
    if date = '01012000'd then event = 'January 1st';
    datalines;
    01012000
    ;
    proc print;
    run;

    ReplyDelete
    Replies
    1. Sadly, your program is not working! Answer is D

      Delete
  9. Anonymous3:56 PM

    Answer is D. because question mentions date constant ( Notice d). Not just '01012000'.

    ReplyDelete
  10. aniket8:06 AM

    ans is D that because 01012000 is changed to its default sas date so when we assign '01012000'd it take it as invalid format...

    ReplyDelete
  11. Anonymous10:45 AM

    the answer should be B.
    Try this,
    data test;
    infile 'calendar';
    input @1 date mmddyy10.;
    if date = '01012000'd then event = 'January 1st';
    proc print;run;

    ReplyDelete
    Replies
    1. Anonymous5:25 AM

      No,the ans is d
      There are 0 observations in the output BECAUSE the date format that is specified is wrong.
      it should be
      if date="01jan1960" then event="january 1st";
      try this

      Delete
  12. Anonymous10:59 AM

    answer is D.

    ReplyDelete
  13. Anonymous9:01 PM

    Syntax error due to incorrect format fails to execute "D" finals answer.

    Sakar Sham

    ReplyDelete
  14. Anonymous2:31 PM

    But in the log it does not say syntax error?

    Aniket , your are right if we take the d out from the statement then it will give this;

    obs date event
    1 14610

    that d is the culprit for error!

    ReplyDelete
    Replies
    1. No, d is not the error, the problem is because of '01012000', if you change '01012000'd to '01JAN2000'd, the problem would be fixed.

      Delete
  15. Anonymous4:32 PM

    data test6;
    infile 'FILENAME';
    input @1 date mmddyy8.;
    if date = '01012000' then event = 'January 1st';
    run;

    Output: 14610 - runs without error but not what we want.

    data test6;
    infile 'FILENAME';
    input @1 date $; *or numeric input @1 date;
    if date = '01012000' then event = 'January 1st';
    run;
    Output: date = 01012000 and event = January 1st

    Both of the above run without errors.

    ReplyDelete
  16. Anonymous9:13 PM

    answer is B

    ReplyDelete
  17. Shilpa9:15 PM

    Answer is B, run the below code, you will get correct answer
    data test;
    input @1 date mmddyy10.;
    if date = '01012000'd then event = 'January 1st';
    datalines;
    01012000
    ;
    run;
    proc print;
    run;

    ReplyDelete
  18. Shilpa9:26 PM

    Sorry Answer is D, ignore the above answer posted by me
    following error appears in the log:
    Invalid date/time/datetime constant '01012000'd.
    Invalid number conversion on '01012000'd.

    ReplyDelete
  19. Anonymous11:54 AM

    Karel;

    If instead of '01012000'd there was standing '01JAN2000'd, the program would have worked with event being January 1st, but with the original notation it doesn't.
    --> Answer D is correct.

    Try this:

    data test;
    infile datalines;
    input @1 date mmddyy10.;
    if date = '01JAN2000'd then event = 'January 1st';
    datalines;
    01012000
    ;
    proc print;
    run;

    ReplyDelete
  20. this is the log file error for me so answer is D


    51 data zak1;
    52 infile "D:\Date.txt";
    53 input @1 date mmddyy10.;
    54 if date = '01012000'd then event = 'January 1st';
    -----------
    77
    ERROR: Invalid date/time/datetime constant '01012000'd.
    ERROR 77-185: Invalid number conversion on '01012000'd.

    55 run;

    NOTE: The SAS System stopped processing this step because of errors.
    WARNING: The data set WORK.ZAK1 may be incomplete. When this step was stopped there were 0
    observations and 2 variables.
    NOTE: DATA statement used (Total process time):
    real time 2.16 seconds
    cpu time 0.01 seconds

    ReplyDelete
  21. Anonymous10:36 AM

    271 data test;
    272 infile "d:\sas\test.txt";
    273 input date mmddyy8.;
    274 if date = '01012000'd then event = 'January 1st';
    -----------
    77
    ERROR: Invalid date/time/datetime constant '01012000'd.
    ERROR 77-185: Invalid number conversion on '01012000'd.

    ReplyDelete
  22. The answer is D because '01012000'd cause the error. We know d function after the date value is to transfer the date into a sas date number. Just think it logically, for value like 01012000, if we used d or date. format to transfer it into sas date value, sas has no way to find out which is month, which is day and which is year, So if we wanted to transfer value like '01012000' into sas date value, we could only mmddyy format to tell sas who is who. So this part caused a syntax error

    ReplyDelete
    Replies
    1. Anonymous6:04 PM

      thank you so much

      Delete
  23. Anonymous5:16 PM

    D is correct.Page 173. DAte constant is 'ddmmmyy'd or 'ddmmmyyyy'd. It assigns date values to variables in assignment statements.

    ReplyDelete
  24. Anonymous5:17 PM

    GM;;
    D is correct.Page 173. DAte constant is 'ddmmmyy'd or 'ddmmmyyyy'd. It assigns date values to variables in assignment statements.

    ReplyDelete
  25. Call us now at OUR toll free. We are Americans #1 Free Chat Line. NO credit card is required! Call Now! FREE CHAT!!! 1-706-443-9999 (over the age of 18). Meet exciting local guys and gals! Site: www.freenitechat.com

    ReplyDelete
  26. First: Infile statement is wrong
    Second: mmddyyy date format is wrong..
    Right ans: Infile __________;
    'mmddyyy'8.

    ReplyDelete
  27. Date should be date='01jan2000'd , it will output the desired January 1st if so.

    Date constant: A date constant is a date in the form of ddMMMyyyy in quotation marks followed by the character d. So, we should write it as a date constant instead of a number in the quotation mark.

    ReplyDelete
  28. Thanks Karen I needed that. I am autistic and on disability.
    gclub
    gclub casino online

    ReplyDelete
  29. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.

    SAS Online Training
    Tableau Online Training|
    R Programming Online Training|

    ReplyDelete
  30. I really like you post,Thanks for your sharing.

    ดูหนังออนไลน์

    ReplyDelete
  31. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
    SAS Data Analytics Training with Placement Support

    ReplyDelete
  32. This blog is really helpful regarding all educational knowledge I earned. It covered a great area of subject which can assist a lot of needy people. Everything mentioned here is clear and very useful.
    สล็อต scr

    ReplyDelete

  33. Very Impressive SAS Programming tutorial. The content seems to be pretty exhaustive and excellent and will definitely help in learning SAS Programming. I'm also a learner taken up SAS Tutorial and I think your content has cleared some concepts of mine. While browsing for SAS Tutorial on YouTube i found this fantastic video on SAS Programming. Do check it out if you are interested to know more.:-https://www.youtube.com/watch?v=4PtMFE4IjLg&t=456s

    ReplyDelete
  34. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work.

    Credo systemz is one of the best R language training in Chennai, and We offers best R programming language training with more real time scenarios.Using this Course you learn very in-depth of R language for Data Science and Machine Learning.

    R Programming institutes in Chennai | R Programming Training in Chennai

    ReplyDelete

  35. Great post! I am actually getting ready to across this information, It's very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.big data training in Velachery | Hadoop Training in Chennai | big data Hadoop training and certification in Chennai | Big data course fees

    ReplyDelete
  36. This comment has been removed by the author.

    ReplyDelete
  37. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums.hadoop training in chennai velachery | hadoop training course fees in chennai | Hadoop Training in Chennai Omr

    ReplyDelete
  38. What a igcp.sas 11skype

    ReplyDelete
  39. That is very interesting; you are a very skilled blogger. I have shared your website in my social networks! A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article.thanks keep post more content.
    C and C++ Training Institute in chennai | C and C++ Training Institute in anna nagar | C and C++ Training Institute in omr | C and C++ Training Institute in porur | C and C++ Training Institute in tambaram | C and C++ Training Institute in velachery

    ReplyDelete
  40. eat post! I am actually getting ready to across this information, It's very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.

    AWS training in Chennai

    AWS Online Training in Chennai

    AWS training in Bangalore

    AWS training in Hyderabad

    AWS training in Coimbatore

    AWS training

    ReplyDelete
  41. พนัน 1xbet es พวกเกมส์ พนันออนไลน์บนโทรศัพท์มือถือ 1xbet ios ฝาก-ถอนไว 1XBET
    พวกน่าดึงดูดอีกหมู่ของเว็บไซต์นี้เป็น 1xbet casino

    เกมส์ – (game)

    หมวดนี้จะเป็นหมวดของเกมส์ทั้งหมดเลยไม่ว่าจะเป็น เกมไพ่ เกมออนไลน์ เอาชีวิตรอด ท้า table games ลูกเต๋า ไต่สู่ชนะ เป่ายิ้งฉุบ อื่นๆอีกมากมาย สำหรับคอเกมส์โดยเฉพาะอย่างยิ่ง มีให้เลือกเล่นมากมายก่ายกอง ให้คอเกมส์ได้เบิกบาน ได้เต็มกำลังเว้นแต่ที่ผมยกตัวอย่างมานั้น ยังมีอีกเยอะมาก เป็นต้นว่า กีฬาเสมอเหมือนจริง โทรทัศน์เกม บิงโก numbers โตโต้ โป๊กเกอร์ ที่ทุกคนสามารถไปเลือกเล่นตามปรารถนาได้เลย

    ท้ายที่สุดเป็นเว็บของพวกเรามีหนทางการติดต่อที่สะดวกแล้วก็วิธีการสมัครที่เรียกง่ายไม่ยุ่งยากมีคณะทำงานรอให้คำปรึกษาขอความเห็นรวมทั้งรอช่วยเหลือตลอด 1 วันยืนยันว่าพนันไมมีผิดหวังอย่างไม่ต้องสงสัย ยังมีค่าทดแทนรวมทั้งเชื่อมั่นในความปลอดภัยไม่ต้องรอกลุ้มใจว่าพนันออนไลน์แล้วจะถูกโกง มีรีวิวจากผู้ใช้งานจริงหลายๆคนว่ามั่นอกมั่นใจและก็ไว้ใจแน่ๆ

    ReplyDelete
  42. Wow. It is such an amazing article. And I would like to bookmark the page so that I can come here again for you to read. What American citizen need visa for Turkey ? Yes , of course all the American Citizens need a visa to visit . Because the USA is not included in the list of those countries which do not require a visa permit to visit Turkey.

    ReplyDelete
  43. Thanks for sharing this article with us... I hope you will continue in the future... The question is how much Indian visa fees are?So The Indian visa fees depend on your visa type, your nationality, and processing time. If you have any kind of doubts check about them and clear your doubts.

    ReplyDelete
  44. Thanks for taking the time to talk about it; it's something I was very excited to know about. In the Computer Vision software. We provide image analysis software for a variety of businesses by combining deep learning and computer vision. If you want to take advantage of this service, go and check out the page.

    ReplyDelete