Desktop productivity for business analysts and programmers

having same variable (392) and different no. of observation for 10 datasets and wants to merge or join

Accepted Solution Solved
Reply
Regular Contributor
Posts: 220
Accepted Solution

having same variable (392) and different no. of observation for 10 datasets and wants to merge or join

Hello Genius,

I have 10 datasets with same no. of variables (392) and same variable names for all datasets. Each dataset having massive no. of observation and i want to join/merge each and every datasets in to one making "ONE BIG DATASET" with all observation from all datasets.

What is the best practice to do so?

Please advise....

Thanks.


Accepted Solutions
Solution
‎01-14-2013 03:10 PM
Super Contributor
Posts: 1,636

Re: having same variable (392) and different no. of observation for 10 datasets and wants to merge or join

try:

data want;

set data1 data2 ...data10;

run;

View solution in original post


All Replies
Super Contributor
Posts: 1,636

Re: having same variable (392) and different no. of observation for 10 datasets and wants to merge or join

Do you want to merge or set? if you want to merge you have to rename some of your variables first.

Grand Advisor
Posts: 17,361

Re: having same variable (392) and different no. of observation for 10 datasets and wants to merge or join

Are you merging the files by a common variable  (10 files * 392 variables ~= 3920 variables ) or appending them together (still 392 variables at the end)?

Regular Contributor
Posts: 220

Re: having same variable (392) and different no. of observation for 10 datasets and wants to merge or join

@ Reeza - adding observation from all 10 datasets and will stay with 392 variables at the end - appreciate your reply...

@Linlin - I am not sure whether i am going to merge or set but again will stay with same no. of variable (392) and adding observations from all 10 datasets...- Thanks


Solution
‎01-14-2013 03:10 PM
Super Contributor
Posts: 1,636

Re: having same variable (392) and different no. of observation for 10 datasets and wants to merge or join

try:

data want;

set data1 data2 ...data10;

run;

Regular Contributor
Posts: 220

Re: having same variable (392) and different no. of observation for 10 datasets and wants to merge or join

Thanks Linlin...Thanks you all for your feedback

☑ This topic is SOLVED.

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

Discussion stats
  • 5 replies
  • 170 views
  • 0 likes
  • 3 in conversation