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
Onyx | Level 15

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
Onyx | Level 15

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

 

 

 

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
yabwon
Onyx | Level 15

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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1146 views
  • 0 likes
  • 3 in conversation