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:

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 748 views
  • 0 likes
  • 2 in conversation