Date: Fri, 30 Mar 2007 10:40:55 -0400
Reply-To: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Subject: Re: iterative %do loop in macro language
In-Reply-To: <BAY123-F27A85CEA894A6DCDD1B347DE6C0@phx.gbl>
Content-Type: text/plain; charset=us-ascii
> From: toby dunn
> I have to wonder why you need to do this but since I dont
> know the bigger picture as David always puts it:
%*1. add named parameters;
%Macro Iter( List =
,MacroName =
,MacroParm =
) ;
> %Local I Stop ;
>
> %Let Stop = %Eval( %SysFunc( CountC( &List , %Str( ) ) ) + (
> %Length( &List
> ) > 0 ) ) ;
>
> %Do I = 1 %To &Stop ;
> %Put Item = %Scan( &List , &I , %Str( ) ) ;
> %Let Item = %Scan( &List , &I , %Str( ) ) ;
%*2. add note to log;
%put calling macro &MacroName.;
%*3. call another macro;
%&MacroName.(&MacroParm. = &Item.);
%End ;
>
> %Mend Iter ;
%*4. add parameter values to macro call;
%Iter( List = import export configure
,MacroName = put :
,MacroParm = ?
);
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
--> cheerful provider of UNTESTED SAS code from the Clue?Gee!Wrx <--
"Nothing is particularly hard
if you divide it into small jobs."
- Henry Ford, Industrialist