Date: Sat, 5 Jan 2002 18:07:50 GMT
Reply-To: Huck <huck@SKIPTHISFINN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Huck <huck@SKIPTHISFINN.COM>
Organization: AT&T Worldnet
Subject: Re: SASTRAP: Macro Quoteing Functions
and just what kind of person is it that posts replies to their own postings again?
i spent hours the first time i ran into this kind of problem before trying the obvious: "%unquote"
my beef is that it looks fine in the log, and in this case if i was expecting upper case inside the
quotes, the solution isnt as easy to see. the first time it was upper case, and i checked every bit
of code that built the variable, put the quotes on, passed it along, printed out debugging stuff
everywhere, and all i kept seeing was my properly quoted string in the log, finally i %unquote'ed
the variable just as it went to the parser, and the problem went away, it happened again, a few
times, before i finaly learned.
i now know what to look for now, "the error makes no sense when compared to whats in the log". When
that happens the first thing to remember is %unquote.
what got me into trouble this time? a macro routine sortof like.
%do %while(0 eq %sysfunc(fget(&_fid,_part,200)));
this utility reads parms from files, and of couse must totaly work in macro quoteing to allow users
to put special characters into the files. when i forgot to unquote the string being passed to
FILENAME, i got into trouble. i tell the parent routine, the one calling utl1, which parms dont need
quoteing, in this case i forgot to mention the one about to be used in the filename statement.
my thanks to the "macro maven" for the %do;%end; without any spaces,
that solution evaded me for years, and is critical to that solution.
On Sat, 05 Jan 2002 05:33:07 GMT, ... some self-replying fool ...... firstname.lastname@example.org (Huck)
>ERROR: Error in the LIBNAME or FILENAME statement.
>MPRINT(MKDRLIST): FILENAME XLATE '/USERS/TEST/NDC.TXT';
the above LOOKS LIKE a perfectly valid filename statment,
it could have an invalid filename, but it is a correct stmt.
one time it was an assignment with this problem, such as a='SOME STRING';
and it wanted an operator between some and string (along with a list of other errors).
i now know what to look for now, "the error makes no sense at all when compared to whats in
the log". When that happens the first thing to try is %unquote. save your self the hours of head
scratching...... it doenst have to be the quote character, percent signs, and ampersands
are escaped, maybe equals signs and some other operators, certain words like and/or ...
if you ever called a quoteing function in this run try %unquote first ... what can it hurt?