76 data students;
77 set perm.students;
78 file 'C:\mysaslib\students';
79 put name $15. @5 age 2.;
NOTE: The file 'C:\mysaslib\students' is:
RECFM=V,LRECL=256,File Size (bytes)=0,
NOTE: 4 records were written to the file 'C:\mysaslib\students'.
The minimum record length was 15.
The maximum record length was 15.
NOTE: There were 4 observations read from the data set PERM.STUDENTS.
NOTE: The data set WORK.STUDENTS has 4 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds
The statement put name $15. @5 age 2.; will be processed as follows:
1. SAS will write the value of name from position 1 through position 15 since the $15. format is used.
2. To write age SAS will start from the 5th position and write a 2 digit value.
If name has more than 4 characters then the 5th and 6th character will be replaced by a two-digit age value. Thus, option B is correct.
The following contents are written in the output file:
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.