You need to login to view this content. Please
Login. Not a Member?
Join Us
Log:
306 data work.accounting;
307 set work.dept1
308 work.dept2;
309 run;
WARNING: Multiple lengths were specified for the variable jobcode by input data set(s). This may
cause truncation of data.
NOTE: There were 3 observations read from the data set WORK.DEPT1.
NOTE: There were 3 observations read from the data set WORK.DEPT2.
NOTE: The data set WORK.ACCOUNTING has 6 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.05 seconds
cpu time 0.03 seconds
Commentary:
The dataset WORK.DEPT1 appears first in the SET statement set work.dept1 work.dept2; wherein the SAS compiler assigns a length of 5 for the variable jobcode whose attributes cannot be change further in program. The log above shows a warning message for multiple lengths of the variable jobcode but all the values read from dataset WORK.DEPT2 are truncated to 5 characters. This is solely because of the order in which the datasets appear in the SET statement.
To change attributes of a variable, we would define the attributes first for said variable in the data step (e.g. LENGTH statement) and then proceed with the SET statement.
Leave a Comment