156 data work.total;
157 infile 'C:\mysaslib\salary' end = eof;
158 input name $ salary;
159 totsal + salary;
160 if eof = 1;
NOTE: The infile 'C:\mysaslib\salary' is:
RECFM=V,LRECL=256,File Size (bytes)=55,
NOTE: 4 records were read from the infile 'C:\mysaslib\salary'.
The minimum record length was 10.
The maximum record length was 14.
NOTE: The data set WORK.TOTAL has 1 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
The END option on the infile statement specifies a variable that SAS sets to 1 when the current input data record is also the last in the input file. Until SAS processes the last data record, the END variable is set to 0. In the statement infile 'file-specification' end = eof; eof is set to 1 for last record in the file. To write only the last observation in the SAS dataset, we can use the subsetting conditional statement if eof = 1; which means option D is correct.
The one and only FREE resource for general SAS online training as well as study guides for the SAS Base Certification. My goal is to create the SAS Certification prep guide that I never found but always wanted. This should also be a place to come if you are new to the language but are simply looking for online SAS training.