Hi All.
I am Appending three data sets namely East, West, North.
Each data sets having six variables with same name.
There is one variable named Rgion which has of length 4 for East and West but of length 5 for North.
I have written the below code snippets to appned
data all;
set east west north;
run;
The data got appended, but in the region for North its coming Nort.
Why this is coming Nort and how to overcome this.
Thanks in advance.
Vishyy
The lengths of variables will be set by the value in the first data set containing the variable. You should have a note in your log about variables with different lengths and possible truncation of data.
You could address that by either ensuring what ever process builds your sets that they have the same characterists before combing or add a Length statement before the SET statement to force all the sets to be treated as having the specified length.
data all;
length Rgion $ 5;
set east west north;
run;
The lengths of variables will be set by the value in the first data set containing the variable. You should have a note in your log about variables with different lengths and possible truncation of data.
You could address that by either ensuring what ever process builds your sets that they have the same characterists before combing or add a Length statement before the SET statement to force all the sets to be treated as having the specified length.
data all;
length Rgion $ 5;
set east west north;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.