Hello everyone,
I would like to ask about the Base question #36,
the topic is:
Xing Bob Jorge 2 19 2004 ACCT 5 22 2004 MKTG 3 14 2004 EDUC data WORK.EMPLOYEE; infile 'EMPLOYEE.TXT'; input @1 FirstName $ @15 StartDate @25 Department $; run;
Which SAS informat correctly completes the program?
A. date9.
B. mmddyy10.
C. ddmmyy10.
D. mondayyr10.
I am confused the difference between the B and C.
Can anyone give me some guidance?
Thank you!
the difference is that mmddyy applies the format in the output view as month day year.
while ddmmyy applies the format in the output view as day month year.
data have;
input date1 date9.;
cards;
20OCT2018
;
proc print data=have;
format date1 mmddyy10.
run;
proc print data=have;
format date1 ddmmyy10.;
run;
The SAS System
Obs date1
1 10/20/2018
--------------------------------------------------------------------------------
The SAS System
Obs date1
1 20/10/2018
Thank you very much.
But the answer to this question is ddmmyy10. instead of mmddyy10.
I felt to correctly output the same format as the raw data set,
we should have used mmddyy10.
Thank you very much again!
you are welcome.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.