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.
And the RC=20 on the END statement would be fine, the manual say:
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.
ADDRESS SYSVIEWE - Interface to SYSVIEW
So, the REXX is working well.
The text should be changed from the ADRESS WTO command to 'NO counts are reset in SYSVCLST'.