Date: Wed, 11 Dec 2002 13:50:14 GMT
Reply-To: julierog@ix.netcom.com
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Roger Lustig <trovato@BELLATLANTIC.NET>
Subject: Re: recruiting cheesy, sleasy SAS tricks
Content-Type: text/plain; charset=us-ascii; format=flowed
Over the years I've written some monster macros that run a whole string
of analyses and produce various outputs. These involve subsetting the
data in more than one way. (Validation samples, data from different
points in time, etc., etc.) To simplify building WHERE statements, I use
WHERE 1=1;
%IF <macro-condition #1> %THEN %DO;
WHERE ALSO <macro-driven filter #1>;
%END;
%IF <macro-condition #2> %THEN %DO;
WHERE ALSO <macro-driven filter #2>;
%END;
...etc...
This way I don't have to worry about the different syntax of the first
WHERE statement.
Cheesy? Sleazy? Lazy is more like it. Yeah!
Roger Lustig
Michael L. Davis wrote:
> Hello Friends,
>
> I'd like to do a Coder's Corner presentation at NESUG next year on the subject of "Cheesy, Sleasy SAS Tricks". As an example, when coding SCL programs, I'm in the habit of including the statement:
>
> rc=rc ;
>
> to suppress the compiler warning that I'm creating the variable rc but not using it.
>
> I'd welcome additional candidates for the role of "cheesy, sleasy tricks". To qualify, they need to be coding declarations or other constructions that suppress the literal mindedness of SAS or its sometimes over-solicitous manner of trying to protect us from ourselves.
>
> I'll be sure to acknowledge useful contributions, selected or otherwise, in the acknowledgement section of the presentation.
>
> BTW, thanks to all for the help last week with regards to reordering the PDV. Unfortunately, the friend for whom I was trolling wanted as easy a method as the RETAIN statement. The ATTRIB statement was to change the length of a variable brought in by a SET statement. So combining the RETAIN and ATTRIB statements did not work (the length was not changed by the ATTRIB statement).
>
> - Michael "Mad Doggy" Davis
>
> Michael L. Davis
> Bassett Consulting Services, Inc.
> North Haven CT 06473-3712
> web: http://www.bassettconsulting.com
> email: michael@bassettconsulting.com
> tel: 203-562-0640
|