Hi to all,
I get these errors msg when my macro was simulating.
ERROR: Overflow has occurred; evaluation is terminated.
ERROR: The macro MYMACRO will stop executing.
How to fix it ? I welcome everything.
Regards
KD
After looking at the macro (got it in private message), I can only underline what @Reeza already suggested. Add %put statements that put your val_mid_1 and val_mid_2 macro variables into the log, so you can see their development.
I also see that you use numeric variables in call symput() without doing a proper conversion to character. This could cause problems creating texts in the macro variables that are then misinterpreted when the %if is resolved. Keep your code clean of any NOTEs about automatic type conversions, and make sure to use a put() function in call symput with a format that is suited to correctly display/convert your values.
PS I don't see anything in the macro that would reveal confidential data, so IMO you can post it safely here.
PPS to illustrate what happens when you have a format overflow in call symput:
%macro mymac;
%let a=5e5;
%let b=4e10;
%if &a > &b %then %put yes; %else %put no;
%mend;
%mymac
data _null_;
a=5e5;
b=4e10;
if a > b then put "yes"; else put "no";
run;
Show us some code 🙂
A simple google seach for the error message gave me this, perhaps that can be of help
I had also seen it before. But on after, they're talking
about SAS OpRisk VaR Server 4.2 that i don't have.
Thanks.
Please show the macro code. You may be trying to put too much into a macro variable.
It is a macro of about 150 lines. It executes well for 1 to 3 iterations.
But fails to execute when i make for more iterations than 3.
Thanks
@DoumbiaS wrote:
It is a macro of about 150 lines.
So what? Without seeing the code, we can't help you.
After looking at the macro (got it in private message), I can only underline what @Reeza already suggested. Add %put statements that put your val_mid_1 and val_mid_2 macro variables into the log, so you can see their development.
I also see that you use numeric variables in call symput() without doing a proper conversion to character. This could cause problems creating texts in the macro variables that are then misinterpreted when the %if is resolved. Keep your code clean of any NOTEs about automatic type conversions, and make sure to use a put() function in call symput with a format that is suited to correctly display/convert your values.
PS I don't see anything in the macro that would reveal confidential data, so IMO you can post it safely here.
PPS to illustrate what happens when you have a format overflow in call symput:
%macro mymac;
%let a=5e5;
%let b=4e10;
%if &a > &b %then %put yes; %else %put no;
%mend;
%mymac
data _null_;
a=5e5;
b=4e10;
if a > b then put "yes"; else put "no";
run;
@DoumbiaS wrote:
Hi to all,
How to fix it ? I welcome everything.
Run the macro with MPRINT and SYMBOLGEN options. Add %PUT statements to the log.
With the vague information here we cannot suggest anything else.
After performing appropriate conversion using call symputx, no further overflow occurred. And needed iterations no longer fail.
Regards and Thanks
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: