Date: Wed, 9 Apr 1997 17:16:05 GMT
Reply-To: John Hendrickx <J.Hendrickx@MAW.KUN.NL>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: John Hendrickx <J.Hendrickx@MAW.KUN.NL>
Organization: Nijmegen University
Subject: Re: Macro Variable and PROC IML Variable
In article <5ie8he$ijn@merck.com>, Zhuo Zang <zangzh@merck.com> wrote:
>Hi,
>
>I like to know if it is possible
>to _directly_ pass the value of a
>PROC IML's variable to a macro variable.
>
>e.g.:
>
>%MACRO TEST;
>
>PROC IML;
>...
>X=2;
>
>...
>QUIT;
>
>%LET Y=(?? X's value);
>
>
>%MEND TEST;
>
This should do the trick:
%MACRO TEST;
PROC IML;
start mat2macr(macnm,scal);
/* give macro variable &"macnm" the value of the scalair */
call execute('%let ',macnm,'=',char(scal),';');
finish;
..
X=2;
* store the value of the scalair X in the macro variable "&Y";
run mat2macr('Y',X);
..
QUIT;
/* Don't need this: */
/* %LET Y=(?? X's value); */
%MEND TEST;
John Hendrickx
Department of Sociology, University of Nijmegen, The Netherlands
|