BookmarkSubscribeRSS Feed
sas_
Fluorite | Level 6
Hi

I am having a library names NEW in that i have 20 datasets like A,RB,CA,DQ,EO,TF,G,Jk,Ed,LO,PI,UI,TY,QW.....with variable names ex-Age id no name in all the above datasets
Now i want to create a new dataset a21 with all the first observarions from datasets names above in to new dataset a21.
5 REPLIES 5
Patrick
Opal | Level 21
Syntax working for SAS9.2:

data a_1 a_2 a_3;
do i=1 to 5;
output;
end;
run;

data a_all;
set a_1 -a_3 (obs=1);
run;

Before SAS9.2 it would be:
set a_1(obs=1) a_2(obs=1).... ;


Message was edited by: Patrick
Peter_C
Rhodochrosite | Level 12
sas_

do you have SAS9.2 or which earlier release?

hth
PeterC.
sas_
Fluorite | Level 6
i am having sas 9.2 .
P_J
Calcite | Level 5 P_J
Calcite | Level 5
Please try something like this to see if it works, I'm using 9.1.3

proc sql;
select cats("NWK.",memname) into :dsn separated by " "
from sashelp.vstable
where libname ="NWK"
;
quit;

options obs=1;
data all;
set &dsn;
run;


%put &dsn=;
sas_
Fluorite | Level 6
Thqs it worked

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2097 views
  • 0 likes
  • 4 in conversation