112 data work.staff;
113 JobCategory = 'FA';
114 JobLevel = '1';
115 JobCategory = JobCategory || JobLevel;
NOTE: The data set WORK.STAFF 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 JobCategory = 'FA'; assigns a value of 'FA' for the variable JobCategory. This variable JobCategory first appears here and the SAS compiler sets a length of 2 for it. This length cannot be changed later on but can be altered explicitly using a LENGTH statement at the beginning of the data step. For the concatenation statement JobCategory = JobCategory || JobLevel; the variable JobCategory would be 3 characters ('FA1') but is instead truncated for the variable JobCategory to the previously defined 2 characters; thus, a value of 'FA' is assigned again to the variable JobCategory and SAS writes the output in the dataset WORK.STAFF as shown below:
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.