I just completed a proc transpose.
proc transpose data=WORK.SIGN1 out=WORK.SIGN2 prefix=E_;
by CLIENT_XID;
id SQID;
var EMAIL;
run;
The E_ = E1, E2, E3, E4, E.....(nth)
Question: How do I use an array in the next data step to:
1. dynamically select all the E1,E2, E3, E....(nth) from WORK.SIGN2
Thank You
Thank You for the reply.
All i want is:
do a dynamic creation of a select from the result of the proc transpose.
select
E_1, E_2,E_3, E,....(nth)
from ....;
select
t1.*
....
from TABLE ( keep= E_: .... ) t1
....
;
Here are a few ways.
https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html
@JohnnySas wrote:
I just completed a proc transpose.
proc transpose data=WORK.SIGN1 out=WORK.SIGN2 prefix=E_;
by CLIENT_XID;
id SQID;
var EMAIL;
run;
The E_ = E1, E2, E3, E4, E.....(nth)
Question: How do I use an array in the next data step to:
1. dynamically select all the E1,E2, E3, E....(nth) from WORK.SIGN2
Thank You
The next step can identify all variable names that begin with E_ into an array in this way:
data want;
set sign2;
array emails {*} E_: ;
*** add logic here if desired ;
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.