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.
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?
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
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.
Is the "RESET_CYCLE" macro sas file in low case letters, i.e. "reset_cycle.sas" ?
Bart
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.
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
Also ensure both: MRECALL and MAUTOSOURCE options are turned on.
Bart
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 25. Read more here about why you should contribute and what is in it for you!
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.