After implementing recommendations to start a TOD rule at midnight, a REXX is started which activates a CLIST but rc=4 and rc = 20 are obtained.
Is there a problem with CLIST or REXX?
SYSVIEW and OPS/MVS, all releases
To run a TOD rule under OP/MVS, this REXX program can be added to the SYSEXEC (rexx) dataset.
This REXX program cleared CICS thresholds count value every day at midnight:
/* rexx */
/*====================================================================*/
/* */
/* AUTO-RESET/CLEARED CICS THRESHOLDS COUNT VALUE EVERY MIDNIGHT */
/* */
/*====================================================================*/
trace I
clearq=OPSCLEDQ() /* Clear EDQ */
Address SYSVIEWE
"Command(SET APISTACK OFF)"
Address SYSVIEWE
'COMMAND(SET CONFIRMDELET NO)'
'COMMAND(CTHRESH NOADDLINE)'
'COMMAND(SELECT COUNT GT 0000)'
'COMMAND(FILL CMD RES 1-99999)'
'COMMAND(SET CONFIRMDELET YES)'
/*--------------------------------------------------------------------*/
/* Cleanup Address SYSVIEWE environment */
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7*/
'COMMAND(END)'
say 'RC ' RC
IF QUEUED() = 0 THEN /* ERROR OCCURRED IF NO DATA */
DO
Address WTO "text('ERROR - NO DATA FROM ADDRESS SYSVIEWE')"
EXIT
END
do while QUEUED() > 0
pull LINE
Address WTO "TEXT(" LINE ")"
/* say LINE */
end
And then use this TOD rule :
)TOD 00:00:00
)PROC
Address TSO
'OI PROGRAM(xxxxx)'
say 'RC ' RC
Where xxxxx is the member name of the above rexx.
About the RC's and the RC=4 is fine, the manual says:
An informational message is returned. Return code 4 is always returned the first time you call the API because the copyright message is displayed when you first invoke SYSVIEW.
Reference the "REXX API Return Codes" area under the "Use the REXX API" section of the SYSVIEW Performance Management Using manual.
And the RC=20 on the END statement would be fine, the manual says:
The END command must be the last command you send to the API. As a result of the END command, the RC variable is set to 20 to indicate that the API has terminated.
Reference the "Address SYSVIEWE - Interface to SYSVIEW" area of the "Host Environment Commands" Section of the OPS/MVS Event Management and Automation Reference manual.
In this instance, the REXX is working well.
The text should be changed from the ADRESS WTO command to 'NO counts are reset in SYSVCLST'.