DATA Step, Macro, Functions and more

Merge - Same variables in all data sets

Reply
Occasional Contributor
Posts: 5

Merge - Same variables in all data sets

[ Edited ]

hi

 

how to concatenate 4 datasets into 1 data set.

 

given the fact that merge cant be used since all data sets have same no of and same variables

 

will SET option work?

 

 

 

Frequent Contributor
Posts: 93

Re: merge

DATA BLARG;
SET BLARG1 BLARG2 BLARG3 BLARG4;
RUN;

Alternatively:

 

PROC SQL;
CREATE TABLE BLARG AS
SELECT * FROM BLARG1
UNION ALL
SELECT * FROM BLARG2;
QUIT;
Super User
Posts: 17,831

Re: Merge - Same variables in all data sets

The SAS docs have a great section on the various ways of combining data:

http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#n0kka0vhqyyx3fn1rl4...

Ask a Question
Discussion stats
  • 2 replies
  • 102 views
  • 0 likes
  • 3 in conversation