| Date: | Sun, 18 May 2003 13:21:47 GMT |
| Reply-To: | julierog@ix.netcom.com |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Roger Lustig <trovato@BELLATLANTIC.NET> |
| Subject: | Re: Storing macro parameters in SASdataset |
| Content-Type: | text/plain; charset=us-ascii; format=flowed |
Dear Muthu:
CALL EXECUTE helps you do this:
********* The macro with a parameter;
%macro hello(num);
data new;
file log;
%put 'Hello' "&num";
%mend hello;
********* The data set that contains the parameter value(s);
data control;
input num;
cards;
1
2
3
4
5
;
run;
********* The program that executes the macro;
data _null_;
set control;
call execute('%hello('||put(num,1.)||')');
run;
Try this, then check the log to see what happened.
Best,
Roger
muthu wrote:
> Hello,
>
> I wish to run a parameterised macro multiple times, with one set of
> parameter values for each run. The values of the parameters for each
> run as stored as records in a SAS dataset. The column names in the
> dataset correspond to the macro parameter names.
>
> Grateful is anyone could help me along with a simplified example.
>
> Many thanks,
>
> Muthukumar
> HSBC Bank Middle East
> Dubai, United Arab Emirates.
|