Hello,
I am trying to run the code below and I receive the following error message: The quoted string currently being processed has become more than 262 bytes long. You might have unbalanced quotation
proc format;
value $vprec '1999' - '9999' = '@2016\@1231';
run;
%macro NATP;
%GLOBAL ANTP VPREC;
%LET VPREC=%SYSFUNC(PUTC(&ANTP,'$VPREC.'));
%MEND ANTP;
%LET AN1=2016;
%ANTP(&AN1);
%LET TOTO ="A108\RATING\COUTPRE2\T&AN1.\&VPREC.";
%put &toto;
could you please try to use the option noquotelenmax;
I can see a few issues, although none of them would cause that message.
The name of the macro is wrong (NATP instead of ANTP).
The macro definition doesn't contain any parameters, yet you call the macro with a parameter.
These two issues mean that you aren't showing the code that you actually used, so it's speculation as to what is causing the problem.
In addition, macro language doesn't use quotes to identify character strings. So the quotes around '$VPREC.' should probably removed. I can't test it right now, but I would be surprised if that worked.
Finally, your character format is suspect. The range '1999' - '9999' almost certainly includes values that you don't want to include. All of these values fall into that range:
500
7ABC
3.14159
It's possible you should be using a numeric format instead.
Thanks for your help. It is very appreciated.
Here's the code that I have test and works properly
proc format;
value $vprec '1999' - '9999' = '@2016\@1231';
run;
%macro ANTP(ANTP=);
%GLOBAL VPREC;
%LET VPREC=%SYSFUNC(PUTC(&ANTP,$VPREC));
%MEND ANTP;
%LET AN1=2016;
%ANTP(ANTP=&AN1);
%LET TOTO ="A108\RATING\COUTPRE2\T&AN1.\&VPREC.";
%put &toto;
Regards,
Alain
This code is a little bit simpler and is also working.
proc format;
value vprec 1999 - 9999 = @2016\@1231;
run;
%macro ANTP(ANTP=);
%GLOBAL VPREC;
%LET VPREC=%SYSFUNC(PUTC(&ANTP,VPREC.));
%MEND ANTP;
When you say the code is working, does that mean the message about unbalanced quotes has vanished?
I would suggest that your numeric format (much preferred, per my earlier comments about the character format) needs quotes around the label:
proc format;
value vprec 1999 - 9999 = '@2016\@1231';
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.