BookmarkSubscribeRSS Feed
Rasheed
Calcite | Level 5

I have data sets like

AD_11  AD_12 ........AD_110

AD_21  AD_22.........AD_210

................................................

AD_111  AD_112.........AD_1110

Each data sets have single observation

Now I want merge data sets AD_11 AD_12  AD_13 ..... AD_110  into data set AAD_1

similarly AD_21 AD_22  AD_23..... AD_210  into data set AAD_2

For this purspose I m using following sas program

data _null_;     

     do j=1 to 11;

          call execute(cats('data AAD_',put(j,8.),';'));

          do i = 1 to 10;

          sk=catt(j,i);

          skn=inputn(sk,'6.',6,0);

          call execute(cats ('set AD_',put(skn,8.),'; rename COL1=A;' ));

          end;

end;                                                                                                                                                                                     run;  

But when I run this program then for inner do loop ( i) it reads 10 obs from 10 data sets AD_11 to AD_110 but save only single value to AAD_1, however it should save all ten observation to AAD_1

1 REPLY 1
Reeza
Super User

Please don't double post - also, the solution was provided in your other thread:

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1065 views
  • 0 likes
  • 2 in conversation