| Date: | Sat, 22 Nov 2008 12:11:49 -0800 |
| Reply-To: | Stefan Dyla <stefan.dyla.rwc@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Stefan Dyla <stefan.dyla.rwc@GMAIL.COM> |
| Subject: | Re: a problem with a macro in batch |
| Content-Type: | text/plain; charset=ISO-8859-1 |
I have written a macro with code generated from metadata in PROC SQL, loaded
into multiple macro variables and executed, as shown in the snippet below
proc sql noprint;
select distinct "create table vw&ds as select 'IR4107' as rule_id, '&ds' as
dataset, 'Invalid NOTDONE code' as message, usubjid as subject,
upcase('%sysfunc(strip(&ds))stat') as column label='Column',
%sysfunc(strip(&ds))stat as actual_value ",
"from sdtm.&ds where %sysfunc(strip(&ds))stat='NOT DONE' and
%sysfunc(strip(&ds))orres ne '';" into :qry_txt, :qry_txt2 from DIR4107;
&qry_txt &qry_txt2
quit;
It works perfectly in the interactive mode but fails miserably in batch.
Despite the fact that no macro variable is longer than 255 characters, the
generated code gets truncated and the macro fails. It looks as if only the
first macro variable is read.
I'm using the mvarsize=max option.
Any way to get round this problem?
Thanks,
Stefan
|