Hello Everyone
I have two SAS datasets
dataset 1. dataset 2
1. 4
2 5
3 6
I want to stack these on top of each other so that the final dataset looks as follows.
Final dataset
1
2
3
4
5
6
I appreciate your help.
Try
data want;
set dataset1 dataset2;
run;
A single column will only work if 1) the variable has the same name and 2) the same-named variable has the same type (numeric or character) in both data sets.
If the values have different lengths in the two sets you may get a warning about different lengths in the log and possible truncation of the data. Do not ignore that warning. Verify that the result is as needed.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.