Understanding Return Code Constants of a CmdRule
search cancel

Understanding Return Code Constants of a CmdRule


Article ID: 50109


Updated On:


SOLVE:Operations Automation SOLVE:Access Session Management SOLVE:FTS SOLVE


When creating new "commands" that can be entered at the console, the system will display

Command ... not found

then use RETURN ACCEPT in the )PROC section of your )CMD rule, so MVS never sees the pseudo command.



Component: SOPMVS


On page 92 of AOF Rules User Guide you may read:

RETURN Statements in the )PROC Section of a CMD Rule

The OPS/REXX RETURN statement specifies the final disposition of a command.

The following are valid values for a RETURN statement in the processing section of a command rule:

NOACTION - Allows z/OS to process a command (command is passed on)
ACCEPT - Prevents z/OS from processing a command (command is "swallowed")
REJECT - Causes z/OS to reject a command as invalid, resulting in message IEE707I cmd NOT EXECUTED

This logic may be a bit difficult to understand, so I'm adding:

The Numeric values for return are 0, 4 and 8 and we created constants, "NOACTION", "ACCEPT" and "REJECT" respectively.

The names of these constants make more sense, if you put yourself in the role of a rule and look from its own perspective:

From a )CMD rule's perspective, "ACCEPT" means, it does (=accepts) the job completely and no one else need to do anything,

while "NOACTION" means, it does little to nothing about it and just delegates.

"REJECT" means, it lets the sender know, that you neither can do something about it, nor you plan to delegate or pass on the task, but you just say NO.

All this happens after the )PROC section of the )CMD rule was processed.