Hi all:
I have codes below. I would like to assign Surv10 in SURV folder, Pneulab in LAB folder and Vax10 in VAX folder into one new folder RDB. I am curious if there is a better way to do it. Thanks.
libname RDBlab "Pathway\data\lab";
libname RDBsurv "Pathway\data\surv";
libname RDBvax "Pathway\data\vax";
libname RDB "Pathway\data";
data RDB.SURV10; set RDBsurv.SURV10; run;
data RDB.PNEULAB; set RDBlab.PNEULAB; run;
data RDB.VAX10; set RDBvax.VAX10; run;
You can refer to these table if their table name is unique.
libname RDB ( "Pathway\data\lab" "Pathway\data\surv" "Pathway\data\vax" );
data x;
set RDB.SURV10;
run;
Hi Reeza:
I used PROC COPY, but really didn't see any simpler than mines.
proc copy out=RDB in=RDBlab memtype=data;
select PNEULAB;
run;
proc copy out=RDB in=RDBsurv memtype=data;
select SURV10;
run;
proc copy out=RDB in=RDBvax memtype=data;
select VAX10;
run;
@ybz12003 when you use a data step SAS copies the data line by line, in case you have any calculations/manipulations.
However, when you use PROC COPY, it copies the data over in blocks instead of a line at a time. For a large data set this has significant time savings, but for smaller tables you may not see an improvement.
I don't think this is any simpler but it seems a bit more clean to me.
proc datasets lib=work;
copy in=sashelp out=work; *from sashelp to work;
select class;
copy in=sasuser out=work; *from sasuser to work;
select funcs;
run;quit;
Oh, I don't know that. Thanks for the clarification.
You can refer to these table if their table name is unique.
libname RDB ( "Pathway\data\lab" "Pathway\data\surv" "Pathway\data\vax" );
data x;
set RDB.SURV10;
run;
Thanks, Kshap. That's awesome!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: