BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tmm
Fluorite | Level 6 tmm
Fluorite | Level 6

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?

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

3 REPLIES 3
ballardw
Super User

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.

tmm
Fluorite | Level 6 tmm
Fluorite | Level 6


Yep. I needed a merge. Thanks

art297
Opal | Level 21

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;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 791 views
  • 0 likes
  • 3 in conversation