Date: Fri, 11 Jan 2002 16:01:07 -0500
Reply-To: Robert Virgile <virgile@MEDIAONE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Robert Virgile <virgile@MEDIAONE.NET>
Subject: Re: SAS Flow
Content-Type: text/plain; charset="iso-8859-1"
Rick,
Check the meaning of the RETURN statement. It sends you back to the top of
the data step, which means you won't get to the PUT statement that follows.
(In cases where the data step contains a LINK statement, RETURN sends you
back to the statement following the LINK statement.)
Other constructive criticism: On the surface of it, there is no apparent
reason that this program should be using macros at all. Why not eliminate
the macros and just use the SAS code itself? Of course, if many programs
share the same lines of code, that might be a reason to use macros. But
it's a question that should be addressed. It is unusual to define macros
which generate exactly the same lines of code each time they run.
Good luck.
Bob V.
-----Original Message-----
From: Rick Bargar <Rick_D_Bargar@CHCMAIL.COM>
Newsgroups: bit.listserv.sas-l
To: SAS-L@LISTSERV.UGA.EDU <SAS-L@LISTSERV.UGA.EDU>
Date: Friday, January 11, 2002 3:37 PM
Subject: SAS Flow
>In my Macro Section at the top of my program I have:
>
>%MACRO R_OPENLF;
> /* READ FROM THE OPEN LATE ACCOUNTS FILE */
>
> INFILE OPENLF EOF=ENDIT MISSOVER;
>
> INPUT @26 OPENLF_NBR $11.
> @;
>
> T='IN R_OPENLF';PUT T=;PUT OPENLF_NBR=; /* debugging statement
*/
> RETURN;
>/* this is unneeded, right? */
> %MEND R_OPENLF;
>
>Then a few more Macros
>Then the Mainline section:
>
>/**/T='BEFORE FIRST READ';PUT T=;
> %R_OPENLF; /* ACCOUNTS THAT HAVE AT LEAST ONE OPEN LF */
> /**/T='AFTER FIRST READ';PUT T=;
> %R_MASTER; /* MASTER FILE */
> /**/T='AFTER MASTER READ';PUT T=;
>
>My debugging statements print the following:
>
>T=BEFORE FIRST READ
>T=IN R_OPENLF
>OPENLF_NBR=80000739450
>T=BEFORE FIRST READ
>T=IN R_OPENLF
>OPENLF_NBR=80001100330
>T=BEFORE FIRST READ
>T=IN R_OPENLF
>OPENLF_NBR=80001581000
>
>Why aren't I hitting the "AFTER FIRST READ" statement?
>Thanks
>Rick Bargar
>
>PS. Any other constructive criticism welcome!
|