ElearnSAS.com

ElearnSAS.com
SAS Learning Platform

Base SAS 39

The following SAS program is submitted:
data work.month;
date = put('13mar2000'd,ddmmyy10.);
run;
Which one of the following represents the type and length of the variable DATE in the output data set?
A. numeric, 8 bytes
B. numeric, 10 bytes
C. character, 8 bytes
D. character, 10 bytes
Click Comment link to get answer

14 comments:

  1. Anonymous3:34 PM

    answer is D

    ReplyDelete
  2. Anonymous2:54 AM

    anyone can please explain why ans is D
    Thank you

    ReplyDelete
    Replies
    1. becoz put function converts num to char thus date be displayed as 03/13/2000, taking up 10 bytes

      Delete
  3. Anonymous11:48 AM

    ddmmyy10. formats date to be 10 bytes in length i.e dd/mm/yyyy, and 'put' converts value into a character type.

    ReplyDelete
  4. Anonymous4:46 AM

    but isnt it the wrong format for put()?

    ReplyDelete
    Replies
    1. no it is correct. Just remember we add format for put but Informat for INput; i with i.. hope it helps.

      Delete
  5. Anonymous4:43 AM

    no.you use a format with put function and informat with input function.format specifies how the value to be written.

    ReplyDelete
  6. Anonymous9:21 AM

    use
    proc contents data=month;
    run;
    you will get to know how the answer is D.

    ReplyDelete
  7. Very nice article,Keep Updating more posts with us.
    Thank you..
    MSBI Online Training India

    ReplyDelete