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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.