From: Subject: Date: Fri, 16 Mar 2012 12:14:41 +1100 MIME-Version: 1.0 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Content-Location: http://members.iinet.net.au/~brucebra/code/utility/HILDALoop.sas X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109
%macro HildaLoop(ver,code);
%* -----------------------------------------------------------;
/* Produces repeated blocks of code, replacing the macro variable WaveL =
with letters
   a,b, etc and the macro variable WaveN with numbers 1, 2, 3 etc up to =
the value of ver.=20
   The code string can contain references to the WaveN and WaveL macro =
variables and
   should be included within a %nrstr() function so that the special =
characters don't=20
   get resolved until needed.=20
   Example:=20
     %HildaLoop(2,%nrstr(if in&WaveL then Wave=3D&WaveN;) );
   This will produce code:
     if inA then Wave =3D 1;
     if inB then Wave =3D 2;
*/
%do WaveN =3D 1 %to &ver;
   %let WaveL =3D %substr(ABCDEFGHIJKLMNOPQRSTUVWXYZ,&WaveN,1);
   %unquote(&code)
%end;
%mend HildaLoop;