Help using Base SAS procedures

proc format ... error message ARNING: The quoted string currently being processed has become more th

Reply
Contributor
Posts: 44

proc format ... error message ARNING: The quoted string currently being processed has become more th

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

marks.
 
Any suggestion?
Regards,
Alain

 

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;

Trusted Advisor
Posts: 1,137

Re: proc format ... error message ARNING: The quoted string currently being processed has become mor

 

could you please try to use the option noquotelenmax;

 

Thanks,
Jag
Super User
Posts: 5,518

Re: proc format ... error message ARNING: The quoted string currently being processed has become mor

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.

Contributor
Posts: 44

Re: proc format ... error message ARNING: The quoted string currently being processed has become mor

Posted in reply to Astounding

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

Contributor
Posts: 44

Re: proc format ... error message ARNING: The quoted string currently being processed has become mor

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;

Super User
Posts: 5,518

Re: proc format ... error message ARNING: The quoted string currently being processed has become mor

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;

Contributor
Posts: 44

Re: proc format ... error message ARNING: The quoted string currently being processed has become mor

Small error in my original code. Here's the good one

proc format;

value vprec 1999 - 9999 = @2016\@1231;

run;

%macro ANTP(ANTP=);

%GLOBAL VPREC;

%LET VPREC=%SYSFUNC(PUTN(&ANTP,VPREC.));

%MEND ANTP;
Ask a Question
Discussion stats
  • 6 replies
  • 159 views
  • 0 likes
  • 3 in conversation