BookmarkSubscribeRSS Feed
jc3992
Pyrite | Level 9

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!

3 REPLIES 3
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

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

 

 

jc3992
Pyrite | Level 9

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!

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

you are welcome.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1141 views
  • 0 likes
  • 2 in conversation