242 data work.accounting;
243 set work.department;
244 length jobcode $ 12;
WARNING: Length of character variable jobcode has already been set.
Use the LENGTH statement as the very first statement in the DATA STEP to declare the length
of a character variable.
NOTE: There were 1 observations read from the data set WORK.DEPARTMENT.
NOTE: The data set WORK.ACCOUNTING has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
cpu time 0.01 seconds
The SAS compiler sets the attributes of the variables when the statement set work.department; occurs in the program and assigns a length of 5 for variable jobcode. These attributes cannot be changed later on in the program. To change the attributes of a variable, we need to define attributes first in the data step and then use the SET statement after. (See the log for more information - a warning message appears for length of variable jobcode).
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.