DATA Step, Macro, Functions and more

keep 1 record from multiple of pdbs

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

keep 1 record from multiple of pdbs

What i want to do is get a value from a variable in multiple pdb's.

 

code:

--

libname in0 '/aaa/bbb/ccc' ;

data temp0;
set
in0.z
in0.y
in0.x
in0.w
in0.v;
keep mmm;
run;

proc print data=temp0 (obs=5);
run;

--

 

so i want to see the value of mmm from z,y,x,w,v.  Im trying to do this as efficently as possible.  Any pointers on how to do with without multiple libname statements?  thank you.


Accepted Solutions
Solution
‎08-21-2017 02:25 PM
Trusted Advisor
Posts: 1,583

Re: keep 1 record from multiple of pdbs

Posted in reply to prolifious

Do you mean:

libname in0 '/aaa/bbb/ccc' ;
data temp0;
set
in0.z(obs=1)
in0.y(obs=1)
in0.x(obs=1)
in0.w(obs=1)
in0.v(obs=1)
;
keep mmm;
run;
proc print data=temp0 (obs=5);
run;

View solution in original post


All Replies
Solution
‎08-21-2017 02:25 PM
Trusted Advisor
Posts: 1,583

Re: keep 1 record from multiple of pdbs

Posted in reply to prolifious

Do you mean:

libname in0 '/aaa/bbb/ccc' ;
data temp0;
set
in0.z(obs=1)
in0.y(obs=1)
in0.x(obs=1)
in0.w(obs=1)
in0.v(obs=1)
;
keep mmm;
run;
proc print data=temp0 (obs=5);
run;
Occasional Contributor
Posts: 12

Re: keep 1 record from multiple of pdbs

Why yes...yes I do.

 

Thanks so much!

☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 71 views
  • 0 likes
  • 2 in conversation