LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2007, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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


Back to: Top of message | Previous page | Main SAS-L page