BookmarkSubscribeRSS Feed
alepage
Barite | Level 11

Hello SAS Experts,

 

I am receiving this error message (The quoted string currently being processed has become more than 262 characters long. You might have unbalanced quotation marks.)  while run the code bellow.

 

How do we correct this problem?

 

Here's my code:

 

 

%let liste1=4514 4530 4532 4548 4557 4595 4598 4621 4631 4673;
%macro loop(vlist);
%let nobs1=%sysfunc(countw(&vlist));/*Number of sale agents*/
%do i=1 %to &nobs1;
%let Temp=%sysfunc(compress(%scan(&vlist,&i)));
%calcul(&Temp);
%rapport(&Temp);
%end;
%loop(&liste1.);

 

log file:

 

1 Le Système SAS 13:04 Monday, January 15, 2018

1 ;*'
_
49
1 ! ;*";*/;quit;run;
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space
between a quoted string and the succeeding identifier is recommended.

2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='VT_Outil Ma Contribution par agent 2018_ALP3'
_______________________________
49
3 ! ;
4 %LET _CLIENTPROCESSFLOWNAME='Flux de processus'
_
49
4 ! ;
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space
between a quoted string and the succeeding identifier is recommended.

5 %LET _CLIENTPROJECTPATH='';
6 %LET _CLIENTPROJECTPATHHOST='';
7 %LET _CLIENTPROJECTNAME='';
8 %LET _SASPROGRAMFILE='S:\IAAH\IaahCycleSAS_DEV\Rapports\TRTRPDNC\Operationnel\VT_Outil Ma Contribution par agent
8 ! 2018_ALP3.sas'
_
49
8 ! ;
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space
between a quoted string and the succeeding identifier is recommended.

9 %LET _SASPROGRAMFILEHOST='LT1300';
10
11 ODS _ALL_ CLOSE;
12 OPTIONS DEV=PNG;
13 GOPTIONS XPIXELS=0 YPIXELS=0;
14 FILENAME EGSR TEMP;
15 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
16 STYLE=HTMLBlue
17 STYLESHEET=(URL="file:///C:/Program%20Files/SAS94/SASHome/SASEnterpriseGuide/7.1/Styles/HTMLBlue.css")
18 NOGTITLE
19 NOGFOOTNOTE
NOTE: The quoted string currently being processed has become more than 262 characters long. You might have unbalanced quotation
marks.
20 GPATH=&sasworklocation
21 ENCODING=UTF8
22 options(rolap="on")
23 ;
24
25 GOPTIONS ACCESSIBLE;
26 %let liste1=4514 4530 4532 4548 4557 4595 4598 4621 4631 4673;
27 %macro loop(vlist);
28 %let nobs1=%sysfunc(countw(&vlist));/*Number of sale agents*/
29 %do i=1 %to &nobs1;
30 %let Temp=%sysfunc(compress(%scan(&vlist,&i)));
31 %calcul(&Temp);
32 %rapport(&Temp);
33 %end;
34 %loop(&liste1.);
2 Le Système SAS 13:04 Monday, January 15, 2018

35
36 GOPTIONS NOACCESSIBLE;
37 %LET _CLIENTTASKLABEL=;
38 %LET _CLIENTPROCESSFLOWNAME=;
39 %LET _CLIENTPROJECTPATH=;
40 %LET _CLIENTPROJECTPATHHOST=;
41 %LET _CLIENTPROJECTNAME=;
42 %LET _SASPROGRAMFILE=;
43 %LET _SASPROGRAMFILEHOST=;
44
45 ;*';*";*/;quit;run;
46 ODS _ALL_ CLOSE;
47
48
49 QUIT; RUN;
50

 

 

6 REPLIES 6
Reeza
Super User

Those errors are actually coming before your code. 

 

What happens if you restart, for a clean session, and submit the following code. Does that generate the same errors?

 

proc means data=sashelp.class;
run;
alepage
Barite | Level 11

I have tried this solution but still the same error?

Quentin
Super User

The code you have showed does not cause the error.  The below runs fine:

 

%let liste1=4514 4530 4532 4548 4557 4595 4598 4621 4631 4673;
%macro loop(vlist);
%let nobs1=%sysfunc(countw(&vlist));/*Number of sale agents*/
%do i=1 %to &nobs1;
  %let Temp=%sysfunc(compress(%scan(&vlist,&i)));
  /** 
  %calcul(&Temp);
  %rapport(&Temp);
  **/
  %put Temp=&Temp ;
%end;
%mend loop ;
%loop(&liste1.);

 

This suggests the problem is either earlier in your code / SAS session, or in one of the macros you are invoking, %calcul or %rapport.

 

Note it looks like your code is missing a %MEND statement to end the definition of %loop.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
alepage
Barite | Level 11

Thanks a lot for your help.

 

Please note that my %MEND statement to end the definition of %loop in not missing (see the 3 last lines)

%end;
%mend loop ;
%loop(&liste1.);

moreover, I agree with you that I have error(s) generated by the execution of my macro function either
%rapport or %calcul;

Regards,
Alain

 

 

Quentin
Super User

Did you copy the last three lines from my post? I added a %MEND to test out your code.

 

Looking at the code and log from your initial post, I don't see a %MEND statement before you call %loop:

 

26 %let liste1=4514 4530 4532 4548 4557 4595 4598 4621 4631 4673;
27 %macro loop(vlist);
28 %let nobs1=%sysfunc(countw(&vlist));/*Number of sale agents*/
29 %do i=1 %to &nobs1;
30 %let Temp=%sysfunc(compress(%scan(&vlist,&i)));
31 %calcul(&Temp);
32 %rapport(&Temp);
33 %end;
34 %loop(&liste1.);

 

Missing a %MEND statement can cause all sorts of interesting problems.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 952 views
  • 0 likes
  • 3 in conversation