Help using Base SAS procedures

Data Set Option

Accepted Solution Solved
Reply
Regular Contributor
Regular Contributor
Posts: 238
Accepted Solution

Data Set Option

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?


Accepted Solutions
Solution
‎01-09-2013 10:44 AM
Super User
Posts: 11,343

Re: Data Set Option

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


All Replies
Solution
‎01-09-2013 10:44 AM
Super User
Posts: 11,343

Re: Data Set Option

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.

Regular Contributor
Regular Contributor
Posts: 238

Re: Data Set Option


Yep. I needed a merge. Thanks

PROC Star
Posts: 7,486

Re: Data Set Option

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;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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