174 data bonus;
175 infile 'C:\mysaslib\Elance_Angela\datarecord.txt';
176 input dept $ 1 - 11 number 13 - 15;
177 department = trim(dept) || put(number,3.);
NOTE: The infile 'C:\mysaslib\Elance_Angela\datarecord.txt' is:
RECFM=V,LRECL=256,File Size (bytes)=15,
NOTE: 1 record was read from the infile 'C:\mysaslib\Elance_Angela\datarecord.txt'.
The minimum record length was 15.
The maximum record length was 15.
NOTE: The data set WORK.BONUS has 1 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds
To concatenate two strings, the operator || can be used.
Option A and Option B have incorrect syntax to concatenate two strings. Option D uses the INPUT function on a character value (to turn into numeric) which is incorrect as it does not result in the desired output.
The PUT function converts a value from number to character according to specified format. Option C has the correct syntax to convert the value of variable number to character format and concatenate the two strings.
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.