Date: Fri, 1 Dec 2006 10:55:56 -0500
Reply-To: Jake Bee <johbee@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jake Bee <johbee@GMAIL.COM>
Subject: Re: macros migrated form mainframe to unix
In-Reply-To: <BAY123-F15C0A60546A58BCA318856DEDA0@phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Toby is correct as usual, but if you have validated code, I would not touch
it.
On 12/1/06, toby dunn <tobydunn@hotmail.com> wrote:
>
> Andre ,
>
> You need to distinguish between what is part of the MAcro conditional
> logic
> and what is part of the Data Step conditional logic. Only the Macro's
> conditional Logic need to have the % tokiens in front.
>
>
>
>
>
> Toby Dunn
>
> Quickly, bring me a beaker of wine, so that I may wet my mind and say
> something clever.
> Aristophanes
>
> Wise people, even though all laws were abolished, would still lead the
> same
> life.
> Aristophanes
>
> You should not decide until you have heard what both have to say.
> Aristophanes
>
>
>
>
>
>
> From: Andre <andrzej_ka@WP.PL>
> Reply-To: Andre <andrzej_ka@WP.PL>
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: macros migrated form mainframe to unix
> Date: Fri, 1 Dec 2006 07:14:28 -0800
>
> Hi,
>
> I have .sas program recently migrated from mainframe machine to unix
> and some part of the code came to my attention ....there is no %
> characters before IF ..ELSE ..THEN DO.. END statements
> I know % character is not used in SCL macro, but I do not know if it is
> correct to omit % in .sas macro? ...
> There is no errors when running that program.
> Is IF .. ELSE .. END treated as local condition and is totally correct
> in a macro?
>
> regards
> Andre
>
> %MACRO UTA;
> ..
> ..
> ..
>
> %IF &INDICA = 1 %THEN %DO;
>
> DATA TASSI_PAESE;
>
> RETAIN M1 31 M2 28 M3 31 M4 30 M5 31 M6 30
>
> M7 31 M8 31 M9 30 M10 31 M11 30 M12 31;
>
> ARRAY MESI(12) M1-M12;
>
> SET TASSI_PAESE;
>
> DURATA=0;
>
> IF TIP0='Y' THEN DURATA=DURATA+365*DUR0;
>
> ELSE IF TIP0='M' THEN DO;
>
> MCORR=&IMLM;
>
> DO II=1 TO DUR0;
>
> DURATA=DURATA+MESI(MCORR);
>
> MCORR=MCORR+1;
>
> IF MCORR GT 12 THEN MCORR=MCORR-12;
>
> END;
>
> END;
>
> %END;
>
> ..
> ..
> ..
> %MEND UTA;
>
> _________________________________________________________________
> View Athlete's Collections with Live Search
>
> http://sportmaps.live.com/index.html?source=hmemailtaglinenov06&FORM=MGAC01
>
|