YEARCUTOFF

Assuming your YEARCUTOFF option is set to 1926, what value does this code display?

DATA df;
variable = '01Jan15'd;
FORMAT MMDDYY10. variable;
RUN;
PROC PRINT DATA = df;
RUN;

A) 01/01/1915
B) 01/01/15
C) 01/01/2015

 

 

 

 

 

 

 

 

 

 

 

Answer: C
Because the date cutoff is 1926, SAS assumes all 2 digit years are after that year. Hence, the actual date value that is stored is 01/01/2015. The system would have returned “01/01/15” if the format had been set to “MMDDYY8.”.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s