Date: Mon, 1 Jul 2002 17:23:24 -0400
Reply-To: "Huang, Ya" <ya.huang@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Huang, Ya" <ya.huang@PFIZER.COM>
Subject: Re: from a list of vars in a macro to an array
Content-Type: text/plain; charset="iso-8859-1"
How about this?
%let mymacro=myvar_1 myvar_2 myvar_3 myvar_4;
data _null_;
call symput('arryint','"'||tranwrd(compbl("&mymacro"),' ','","')||'"');
run;
%put &arryint;
data xx;
array vv(4) $8 (&arryint);
run;
proc print;
run;
Kind regards,
Ya Huang
-----Original Message-----
From: JSD [mailto:jsdavid1@HOTMAIL.COM]
Sent: Monday, July 01, 2002 2:09 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: from a list of vars in a macro to an array
Listers,
I have a question conerning transporting the contents of a macro (a
variable list) to an array. Here is an example of what I would like
to do.
The contents of &mymacro would contain:
myvar_1 myvar_2 myvar_3 ... myvar_k
/* Problem starts below */
I would like to pass the contents of &mymacro on to an array. For
example,
array vv[k] $8. ("myvar_1","myvar_2","myvar_3", ... "myvar_k");
Has anyone encountered something like this? Any help or suggestions
would be appreciated.
Best,
JSD
|