Date: Tue, 29 Dec 1998 13:16:36 -0600
Reply-To: Jack Hamilton <jack_hamilton@FIRSTHEALTH.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Jack Hamilton <jack_hamilton@FIRSTHEALTH.COM>
Subject: Re: Macro params > 200 chars long...?
Content-Type: text/plain; charset=US-ASCII
Two suggestions, neither one tested:
- Use the IN operator instead:
if "VARNAME5" in (&VARLIST) then ...
VARLIST would have to consist of quoted strings, but you could
do that in your macro. Just use the %SCAN function to step
through the words in the string.
- Rewrite your program to use the %INDEX macro function instead of
the INDEX data step function. If you're in a macro already, that
might be easier.
James Carter <jcarter@SCTCORP.COM> wrote:
> In a fairly involved macro I've written, one of the
>parameters has started to exceed the ever-popular 200 character
>limit. I seem to recall a discussion on this topic a few months
>(years?) ago. Does anyone know of any tips/tricks for getting
>Here's an (obviously mocked-up) example:
> GOTIT = 0;
> IF INDEX("&VARLIST","VARNAME5") > 0 THEN GOTIT = 1;
> IF GOTIT THEN DO;
> PUT "GOT IT!";
>%MAC( VARLIST=VARNAME1 VARNAME2 VARNAME3 VARNAME4 VARNAME5,
>In this example, an increasing number of variable names in the
>VARLIST macro var is
>causing VARLIST to get bigger than 200 chars...