I just did a data set option but I don't want the data to be placed on different rows. I have 12 tables that all have 1 row with 4 columns of monetary data. I did the following data step:
data all; set t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12;
run;
my all table now has 12 rows and 16 columns. How can I get it to have 1 row and 16 columns? All the columns have different names so I know what value came from where. Should I do a proc transpose or maybe I should just do a proc sql and create a table?
The SET statement basically tells SAS to add the data from the separate data sets after each other.
It sounds like you may have wanted to use MERGE instead of set.
The SET statement basically tells SAS to add the data from the separate data sets after each other.
It sounds like you may have wanted to use MERGE instead of set.
Yep. I needed a merge. Thanks
You could use:
data all;
set t1;
set t2;
set t3;
set t4;
set t5;
set t6;
set t7;
set t8;
set t9;
set t10;
set t11;
set t12;
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.