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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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