The contents of the raw data file EMPLOYEE are listed below:
--------10-------20-------30
Ruth 39 11 (39 starts at col-7 and 11 at col-10)
Ruth 39 11 (39 starts at col-7 and 11 at col-10)
Jose 32 22
Sue 30 33
John 40 44
The following SAS program is submitted:
data test;
infile 'employee';
input employee_name $ 1-4;
if employee_name = 'Ruth' then input idnum 10-11;
else input age 7-8;
run;
infile 'employee';
input employee_name $ 1-4;
if employee_name = 'Ruth' then input idnum 10-11;
else input age 7-8;
run;
Which one of the following values does the variable IDNUM contain when the name of the employee is "Ruth"?
A. 11
B. 22
C. 32
D. . (missing numeric value)
B. 22
C. 32
D. . (missing numeric value)
6 comments:
B. 22
B.22
data work.TEST;
infile cards;
input employee_name $ 1-4;
if employee_name = 'Ruth' then input idnum 10-11;
else input age 7-8;
put _all_;
cards;
employee_name=Ruth idnum=22 age=. _ERROR_=0 _N_=1
employee_name=Sue idnum=. age=40 _ERROR_=0 _N_=2
NOTE: The data set WORK.TEST has 2 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.12 seconds
cpu time 0.03 seconds
every input statement will attack a new line , hence idnum=22
PLS EXPLAIN
Post a Comment