02-26-2015 01:35 PM
I have a macro variable named &_badFileName. It contains the value &cmpn_cd_YYYYMMDD_TEST_DONT_LOAD. The code runs in open code, not a macro.
I need to print the text vallue of the macro variable in an error message _without_ the value of &cmpn_cd being resolved. I want to see the string &cmpn_cd_YYYYMMDD_TEST_DONT_LOAD in my error message.
I've tried all of the quoting function I can think of.
I've tried nesting some of the functions.
I've tried using quoting functions in a %let statement to reassign the value of &_badFileName there instead of in the putlog statement.
But they either try to resolve &_badFileName and return the Error seen below below or prevent resolution of &_badFileName so that &_badFileName prints in the message as text.
It seems to me that I need a quoting function that masks resolution at execution. I'm sure I'm missing something simple, but Help will be greatly appreciated. Thanks in advance.
9707 data _null_;
19708 putlog '-----';
19709 putlog "USER-DEFINED ERROR: At least 1 Output File Name in the &_excelWorkbookName Output_Fields worksheet is
19710 putlog ' It must contain a valid date formatted as YYYYMMDD.';
19711 putlog " The bad Output File Names are %nrbquote(&_badFileNames)..";
ERROR: Symbolic variable name CMPN_CD_YYYYMMDD_TEST_DO_NOT_LOAD must be 32 or fewer characters long.
19712 putlog '-----';
02-26-2015 02:03 PM
putlog "The bad Output File Names are " badfile;
...or this way:
putlog "The bad Output File Names are %superq(_badFileName)";
02-26-2015 02:11 PM
Astounding, that's it!! %SUPERQ() doesn't want the & for the macro variable. I knew I was missing something simple.
Patrick, Thanks for a workable second solution. Sometimes I get so fixated on a specific solution that I don't stop, take a breath, and consider alternatives. If I could give you both Correct Answer credit I would, but Astounding was first by a few minutes.
Need further help from the community? Please ask a new question.