BookmarkSubscribeRSS Feed
StickyRoll
Fluorite | Level 6

I am getting the warning and error of:

WARNING: Apparent invocation of macro RESET_CYCLE not resolved.

MLOGIC(PURGE_RGF): Ending execution.
NOTE: Line generated by the CALL EXECUTE routine.
4 + %reset_cycle(cycle_id= 11534)
_
180

ERROR 180-322: Statement is not valid or it is used out of proper order.
My script is as follows.
options mlogic mprint symbolgen;
%include "&SAS_APP_ROOT./SASIRM/custom/utilities/housekeep/ucmacros/dm_rgf_rest_delete_cycle.sas";
%let SAS_APP_ROOT2 = /sas/config;
%macro see_rgf(retention_period=100);

%let retention_period_days=%SYSEVALF(&retention_period * 31);

%let APPDATA_HOME=&SAS_APP_ROOT.;
%let SASIRM_HOME=&APPDATA_HOME./SASIRM;

%include "&SASIRM_HOME./custom/utilities/batch_run/custom/sas_env.sas";


option insert = ( 
	sasautos = (
				"&SAS_APP_ROOT2./ucmacro"
               "&SASIRM_HOME./&frs_id./irm/source/sas/ucmacros"
               "&SASIRM_HOME./&rmc_id./irm/source/sas/ucmacros"
               )
	set = CLASSPATH "&SASIRM_HOME./irm/source/java/lib/pdfUtils.jar");

filename LUAPATH ("&SASIRM_HOME./&frs_id./irm/source/lua"
                  "&SASIRM_HOME./&rmc_id./irm/source/lua"
                  "!SASROOT\modimpsvr\lua" "!SASROOT\rmifirmmva\lua" "!SASROOT\stresssvr\lua"
                  ); 
<sas code>
<sas code>
<sas code>
<sas code>
<sas code>
<sas code>
data _null_;
set info;
call execute ('%reset_cycle(cycle_id='||key||')');
run;

%mend;
%see_rgf;
I have a reset_cycle.sas program resided in /sas/config/ucmacro with code %macro reset_cycle() in it. However, I am getting this issue. What could possible be wrong here?
6 REPLIES 6
yabwon
Amethyst | Level 16

Try to do something like:

%macro testExecution();
  %if %SYSMACEXIST(RESET_CYCLE)=1 %then
    %RESET_CYCLE(...);
  %else %put ERROR: RESET_CYCLE does not exist;
%mend;

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



StickyRoll
Fluorite | Level 6

Hey there, this is the result:

 NOTE: There were 1 observations read from the data set WORK.INFO.
 NOTE: The data set WORK.INFO has 1 observations and 27 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 MPRINT(PURGE_RGF):   data _null_;
 MPRINT(PURGE_RGF):   set info(obs=1);
 MLOGIC(PURGE_RGF):  %IF condition %SYSMACEXIST(RESET_CYCLE)=1 is TRUE
 MLOGIC(PURGE_RGF):  %PUT reset_cycle exists
 reset_cycle exists
 MPRINT(PURGE_RGF):   run;
 

It means reset_cycle resolved to TRUE.

yabwon
Amethyst | Level 16

Is the "RESET_CYCLE" macro sas file in low case letters, i.e. "reset_cycle.sas" ?

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



StickyRoll
Fluorite | Level 6

the SAS program is all small letter "reset_cycle.sas"

Furthermore, the macro name inside "reset_cycle.sas" is

%macro reset_cycle(id=);

 

I couldn't think of any other possible issue causing this issue.

 

Quentin
Super User

if you %include "&SAS_APP_ROOT2./ucmacro/res/reset_cycle.sas" will that load the macro and get it to work?

 

If so, I would start a new SAS session and try again. As @yabwon mentioned, it's a good idea to keep option mrecall turned on while debugging autocall macros.

 

If it's turned off, SAS will only look for an autocall macro definition once (per session).  If you try to call a macro, and it can't find it because it's not in sasautos or whatever, and they you change the directories listed in sasautos and call the macro again, SAS won't look again, it will just say 'not resolved' without looking for it. 

 

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n0cfvf12looza7n10yaa4foizemd.htm

 

 

 

yabwon
Amethyst | Level 16

Also ensure both: MRECALL and MAUTOSOURCE options are turned on.

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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