Thank you, Michelle, that worked. Btw, is there a way to have a macro contain a numeric? And as follow-up to arrays, I am trying to do the following: (1) change missings to 'zzzzz', and then add leading zeros e.g., make '123' be '00123'. All variables are character length 5. However, I get an invalid argument to the input function below. When I don't use arrays, it works fine. I'd appreciate your advice. Last, I'm running out of disk space. Is there a way to do this without creating two additional sets of variables (i.e., proclistb and proclistc)? Thanks, Brent %let proclist proc1 proc2 proc3; %let proclistb=proc1b proc2b proc3b; %let proclistc=proc1c proc2c proc3c; run; *change missings to zzzzz, add leading zeros; data new; set old; array a {*} $5 &proclist; array b {*} $5 &proclistb; array c {*} $5 &proclistc; do j=1 to dim(a); if a{j}~=' ' then b{j} = a{j}; else b{j}=zzzzz; /* do i need to have it be 'zzzzz' ?*/ c{j} = put(input(b{j},best.),z5.); end; run;
... View more