SAS Certified Base Programmer 123 Questions (114)
The contents of the raw data file CALENDAR are listed below:
----|----10---|----20---|----30 01012000
The following SAS program is submitted:
data test; infile,calendar'; input@1 data mmddyy10.; if date='01012000'd then event='january 1st'; run;
Which one of the following is the value of the EVENT variable?
A. 01012000
B. January 1st
C. . (missing numeric value)
D. The value can not be determined as the program fails to execute due to errors.
Topics:
SAS Base Questions |
10 Comments »
D
Could you please explain the reason? Thank you very much.
@2. roxanne …..I confirmed that D is correct…you should install SAS and try it.
yes,now i can understand that. thank you!
correct infile statement as infile ‘calendar’;
reason of errors :-
1> ‘data’ instead of date….(ok..it may be a simple spelling mistake)
2>wrong informat
I still don’t get why it is not C. For example, if I try to input a numeric variable when the raw file actually has a character, the execution will keep going and I get missing value as the value.
@2, ‘01012000’d is not correct date constant form, general form of date constant is ‘ddmmmyy’d or ”ddmmmyy”d.
answer is d becoz for calender it should be closed with qoutes thats y it is a syntax error
a comma at infile statement
date variable does not exist