142 data flowers;
143 infile 'C:\mysaslib\typecolor';
144 input type $ 1-5 +1 color $;
NOTE: The infile 'C:\mysaslib\typecolor' is:
RECFM=V,LRECL=256,File Size (bytes)=11,
NOTE: 1 record was read from the infile 'C:\mysaslib\typecolor'.
The minimum record length was 11.
The maximum record length was 11.
NOTE: The data set WORK.FLOWERS has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
The statement input type $ 1-5 +1 color $; will read the first 5 characters for the variable type and set the value as 'daisy'. The +1 tells SAS to start reading the value after skipping one character. Thus, characters from position 7 will be read and the value 'ellow' is set for the color variable.
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.