SETMAX – Manipulate the maximum return code
Use the SETMAX
command to modify
the maximum return code and maximum response code, at any point in
the Workload Automation Programming Language command
sequence.
SETMAX POLICY(<in_rc1>=<out_rc1>,<in_rc2>=<out_rc2>,...,
<in_rcn>=<out_rcn>,<catch_all>)
[SET(MAX_RC|MAX_RESP|BOTH)]
The command takes the current maximum return code, or maximum response
code, or both, and use the POLICY
keyword,
looking for a match on the left side of each expression (in_rc
).
If a match is found, it sets the new maximum to the right side of
the expression (out_rc
).
If no match is found it, it sets the return code to the specified catch_all
return
code. If you omit to supply a catch all return code, and there is
no match, the return code remains unchanged.
This command can influence maximum values: the maximum return code
and maximum response code. The maximum response code is a special
case of return code that is set by commands such as LISTSTAT
,
which sets the return codes to communicate the status of an HCL Workload Automation for Z object
to other steps outside Workload Automation Programming Language.
However, the number of variants of return code to do this usually
exceeds the critical return code (set by OPTIONS STOPRC
),
which would flush the remaining Workload Automation Programming Language processing.
To avoid this, commands of this type set a response code, which is
returned by Workload Automation Programming Language when
it completes, if it is higher than the maximum return code.
SETMAX
command
will affect, use the SET
keyword with one
of the following arguments:MAX_RC
- Default. Compares the
POLICY
against the current maximum return code, and modifies the maximum return code if a match is made within thePOLICY
. It also sets the return code of theSETMAX
command to the same value. MAX_RESP
- Compares the
POLICY
against the current maximum response code, and modifies the maximum response code if a match is made within thePOLICY
. It does not set the return code of theSETMAX
command. BOTH
- Compares with the higher of the current maximum return code and
maximum response code. It modifies both if a match is found within
the
POLICY
. It also sets the return code of theSETMAX
command to the same value.
LIST
statement
is reversed. If something is found, typically you would get RC=0 and
if not found you would get RC=4. The SETMAX
statement
reverses that, so you can have a situation where the “good outcome”
is for something to not be there (RC=0) and the “bad outcome”
is if it is found (RC=4).05/28 12.55.11 EQQI200I LIST CPOPCOM ADID(TWSCDAILYPLAN) OPNO(010)
IA(0805281300)
05/28 12.55.12 EQQI299I Statement completed - RC=4
05/28 12.55.13 EQQI200I SETMAX POLICY(0=4,4=0)
05/28 12.55.13 EQQI122A Maximum return code 4 changed to 0
05/28 12.55.13 EQQI299I Statement completed - RC=0
SETMAX POLICY(0=0,4=4,8=8,12=12,16=16,20)
LISTSTAT
. This would set the maximum
response code from any previous LISTSTAT
commands
to zero, but not alter the maximum return code as set by other processes:SETMAX POLICY(0) SET(MAX_RESP)
SETMAX SET
keyword
can be influenced by OPTIONS SETMAX
.