How to clear the messages from the Alert Monitor if alerts are not closing manually. Want to have alerts that are forwarded automatically cleared. Or else have them cleared after a set time period. Otherwise no clearing alerts will fill the alerts monitor buffer.
Release : 11.9
Component : CA SOLVE:Operations Automation for z/OS
Created a custom proc for EXPIRE/CLOSE alerts after 3 days
See example below, it runs on a TIMER each day and will delete any Alert older than 3 days. Add this proc to a member in TESTEXEC Library:
-* &CONTROL TRACELOG
&#AM$KEY = &NMID
&#AM$KEY = &SETLENG 12
&#AM$KEY = &CONCAT &#AM$KEY 0
&#AMTDATE = &DATECONV DATE8 &DATE8 DATE8 -3
&VARTABLE GET ID=$AMACTALERTS SCOPE=GLOBAL OPT=KGT KEY=#AM$KEY +
FIELDS=(.KEY,MDO) VARS=(#AM$KEY,$AMALERT.)
&ASSIGN VARS=#AM$WKSYS +
FROM MDO=$AMALERT.SYSTEMID
&DOWHILE 0&ZFDBK EQ 0 AND .&#AM$WKSYS EQ .&NMID
&ASSIGN VARS=#AM$WKDATE +
FROM MDO=$AMALERT.DATE
&IF &#AM$WKDATE GE &#AMTDATE &THEN &GOTO .ARND
&ASSIGN VARS=#AM$WKTIME +
FROM MDO=$AMALERT.TIME
&ASSIGN VARS=#AM$APPLID +
FROM MDO=$AMALERT.APPLID
&ASSIGN VARS=#AM$CLASSID +
FROM MDO=$AMALERT.CLASSID
&ASSIGN VARS=#AM$RESID +
FROM MDO=$AMALERT.RESID
-* &#AM$RESID = &ZQUOTE2 &#AM$RESID
&ASSIGN VARS=#AM$RESOURCE +
FROM MDO=$AMALERT.RESOURCE
-* &#AM$RESOURCE = &ZQUOTE2 &#AM$RESOURCE
&DELAY .1
&CALL PROC=$RMAMAPI +
PARMS=(CALLTYPE=ALERT_CLEAR,+
APPLID=&#AM$APPLID,+
CLASSID=&#AM$CLASSID,+
RESID='&#AM$RESID',+
RESOURCE='&#AM$RESOURCE')
.ARND
&VARTABLE GET ID=$AMACTALERTS SCOPE=GLOBAL OPT=KGT KEY=#AM$KEY +
FIELDS=(.KEY,MDO) VARS=(#AM$KEY,$AMALERT.)
&ASSIGN VARS=#AM$WKSYS +
FROM MDO=$AMALERT.SYSTEMID
&DOEND
&END