Base SAS Certification Questions and important concepts needed to ace the exams.
ElearnSAS.com
SAS Learning Platform
Base SAS 93
The following SAS program is submitted: data revenue; set year_1; var1 = mdy(1,15,1960); run; Which one of the following values does the variable named VAR1 contain? A. 14 B. 15 C. 1151960 D. '1/15/1960' Click Comment link to get answer
For SAS certification we need to assume that YEARCUTOFF option is set to 1JAN1960. This date is represented as 0 in SAS date format. Now MDY function will change normal date to SAS date, we are passing 15JAN1960 as the parameter to mdy which is 14th day from 1JAN1960, hence answer is option A. Hope this helps.
I am sorry, but the defalt value for yearcutoff is always 1920. That doesn't have anything to do with the SAS start date which is 1st Jan, 1960. Try to run the following code if you have doubt.
Ranju is right. As the year is in four digit (1960 not just 60), yearcutoff option has nothing to do with this question. Thanks Ranju for correcting.
SAS dates are special numeric values representing the number of days between January 1, 1960, and a specified date. For eg 1jan1959 = -365 1jan1960 = 0 1jan1961 = 366
Keep it in mind that jan 1, 1960 = 0, and jan2, 1960= 2. keep going up until 15Jan, 1960, what ever you get is the answer. Therefore ans = (A). It will not write in date format until we use date format / informant. Do you have still question? it will not write the date until sakar60
Answer is A
ReplyDeleteA
ReplyDelete(1960)
ReplyDeleteThe Ans is A. 14
The MDY function creates a SAS date value from numeric values that represent the month, day, and year.
can anyone please explain me in detail
ReplyDeleteFor SAS certification we need to assume that YEARCUTOFF option is set to 1JAN1960. This date is represented as 0 in SAS date format. Now MDY function will change normal date to SAS date, we are passing 15JAN1960 as the parameter to mdy which is 14th day from 1JAN1960, hence answer is option A. Hope this helps.
ReplyDeletethanks for explaination very clear
Deletethank you for explanation
DeleteI am sorry, but the defalt value for yearcutoff is always 1920. That doesn't have anything to do with the SAS start date which is 1st Jan, 1960. Try to run the following code if you have doubt.
ReplyDeleteproc options;run;
Thank you
ReplyDeletethank you
ReplyDeleteRanju is right. As the year is in four digit (1960 not just 60), yearcutoff option has nothing to do with this question. Thanks Ranju for correcting.
ReplyDeleteSAS dates are special numeric values representing the number of days between January 1, 1960, and a
specified date.
For eg
1jan1959 = -365
1jan1960 = 0
1jan1961 = 366
This is great and helpful. Thanks to Ranju and SASCERT.
ReplyDelete1960 leap year , so 1st jan ,1961 should be 367.
ReplyDeleteby joydeep786@gmail.com
January 1, 1960 0
ReplyDeleteJanuary 1, 1961 366
Answer is A which is 14. Still not a good logic presented.
ReplyDeletejan 1 , 1960 = 0
ReplyDeletejan 15, 1960 = 14
Keep it in mind that jan 1, 1960 = 0, and jan2, 1960= 2.
keep going up until 15Jan, 1960, what ever you get is the answer. Therefore ans = (A).
It will not write in date format until we use date format / informant.
Do you have still question?
it will not write the date until
sakar60
" Keep it in mind that jan 1, 1960 = 0, and jan2, 1960= 2. "
DeleteThat is incorrect.
mdy( 1,1,1960) = 0
mdy( 1,2,1960) = 1
Try this sytax in SAS
A
ReplyDelete