Jose,47,210
Sue,,108
The following SAS program is submitted using the raw data file above as input:
data employeestats;
input name $ age weight;
run;
Which of the following INFILE statements completes the program and accesses the data
correctly?
a. infile 'file-specification' pad;
b. infile 'file-specification' dsd;
c. infile 'file-specification' dlm=',';
d. infile 'file-specification' missover;
The following output is desired:
name age weight
Jose 47 210
Sue . 108
Check the comments below for answers....
4 comments:
Answer; b
The PAD option specifies that SAS pad variable length records with blanks. The MISSOVER
option prevents SAS from reading past the end of the line when reading free formatted data. The
DLM= option specifies the comma as the delimiter; however, consecutive delimiters are treated as
one by default. The DSD option correctly reads the data with commas as delimiters and two
consecutive commas indicating a missing value like those in this raw data file.
infile 'file-specification' missover;
missover
prevents an INPUT statement from reading a new input data record if it does not find values in the current input line for all the variables in the statement. When an INPUT statement reaches the end of the current input data record, variables without any values assigned are set to missing.
b
B
Post a Comment