SAS Certified Base Programmer 50 Questions (1)
A raw data file is listed below.
1---+----10---+----20---+ son Frank 01/31/89 daughter June 12-25-87 brother Samuel 01/17/51
The following program is submitted using this file as input:
data work.family; infile 'file-specification'; <insert INPUT statement here> run;
Which INPUT statement correctly reads the values for the variable Birthdate as SAS date values?
a. input relation $ first_name $ birthdate date9.;
b. input relation $ first_name $ birthdate mmddyy8.;
c. input relation $ first_name $ birthdate : date9.;
d. input relation $ first_name $ birthdate : mmddyy8.;
Topics:
SAS Base Questions |
8 Comments »
D
answer
A
Answer is D
because ‘:’ must be there after the variable need to change
The correct answer is B.
there is no : before formatting a data so D cannot be the right answer.
“:” helps to read immediate value after spaces. Ans is D
The true answer is D not A.
The reason:
When you are reading an external file you must wirte (colon 🙂 and the correct format.
The answer D, is right.
Try it on sas 😉
Both B & D are correct for given input data.
But D will not be correct if there is birthday value as “10 20 84”, Hence B is the best answer.