OPS/MVS

 View Only

 Sample rule JESSTACK missing?

Marcel van Ek's profile image
Marcel van Ek posted Mar 06, 2026 08:35 AM

I was researching how to handle stacked JES2 commands and come upon this in the OPS/MVS R14 current doc:

JES2 Stacked Command Guidelines
Use the following guidelines when you are creating CMD rules to process JES2 stacked commands:
When CMDDELIM is set to a semicolon (
;
), and the issuing console is an MCS or SMCS console, stacked JES2 commands can only be issued in the form
$cmd1;$cmd2;$cmd3
, for example:
$PI1;$TI1,C=X;$SI1
In this situation, either stacked JES2 commands trigger an associating unique CMD rule, or a wildcard catch-all JES2 CMD rule is executed for each stacked command.
Example
A
)CMD $*
rule would execute three times (once for each command).
A
)CMD $P
rule would execute once.
A
)CMD $T
would execute once.
A
)CMD $S
rule would execute once.
When CMDDELIM is not set, there is no z/OS command stacking.
When CMDDELIM is set to either of the following:
to some value other than a semicolon (
;
)
to a semi-colon (
;
) when the issuing console is not an MCS or SMCS console
. . . stacked JES2 commands can be issued in the following format:
$cmd1;cmd2;cmd3.
For example:
$PI1;TI1,C=X;SI1.
The entire list of commands that is stacked together is treated as one command. This command is processed either by one CMD rule that processes all JES2 commands or by a specific CMD rule that processes the first command within the list of stacked commands.
Example
A
)CMD $*
rule would execute once for the complete stacked command.
A
)CMD $P
rule would execute once for the complete stacked command.
In both cases, code additional rule logic to interrogate the value of the cmd.text environmental variable.
To process and automate various JES2 commands, create a catch-all JES2 rule that rejects command stacking. To implement this type of control logic, see the sample rule JESSTACK in the
 CCLXRULS
data set.
Now I cannot find the JESSTACK member in our CCLXRULS (or any other rules) dataset. Is the doc and/or the member old/obsolete, or did it somehow get lost?
George Liang's profile image
Broadcom Employee George Liang

Hi, Marcel

Thanks for the topic. We have not found it either even though we checked all the versions back to OPS 11.8. 

May I know what specific logic you would like to implement? 

Thanks

George

Marcel van Ek's profile image
Marcel van Ek

George, we are looking into preventing some JES2 commands during a certain period. Obviously, that should include those that are stacked ;)

George Liang's profile image
Broadcom Employee George Liang

Hi, Marcel

I think the Example 1 rule )CMD $T (as copied to here below) in the doc is showing the idea:  

)CMD $T
)PROC
/* Attempting to fire on a JES2 command means we must have a */
/* specifier of the JES2 command character (normally $)      */
/* followed by the first letter of the desired command       */
/* (T FOR TIxxx). Since many JES2 commands begin with a 'T'  */
/* (For example: $TIXXX,TPRTXXX) we must check the           */
/* environmental variable CMD.TEXT to see the exact text of  */
/* the command that was entered. Leave the rule if this      */
/* is not a JES2 initiator control command. SSICMD parm must */
/* be set to YES for JES2 CMD control.                       */

if SUBSTR(CMD.TEXT,1,3) ¬= '$TI' then
  return

/* Use the OPS/REXX OPSINFO function to get current sysplex  */
/* master console value, then compare this value to the      */
/* value of the console that issued the command which is     */
/* contained in the CMD.CONSNAME event variable. If this     */
/* is not the sysplex master, we'll send a message back to   */
/* console and null out the command so JES2 won't see it.    */

PLEXMSTR= OPSINFO('MSTCONSNM')
if CMD.CONSNAME ¬= PLEXMSTR then
  do
    msgtxt = 'JES2 init control not allowed from this console'
    ADDRESS WTO
    "MSGID(OPSMVS01) TEXT('"msgtxt"') HILITE",
    "CNNAME("CMD.CONSNAME")"
    CMD.TEXT = ''
    return 'ACCEPT'
  end
else
  return                                  /* OK to issue */

Since the stacked commands are treated as multiple individual command issued in sequence, the command rule will fire on each command and determine what to do according to the value of cmd.text.

For your idea of 'preventing some JES2 commands during a certain period', I think of a TOD rule for controlling when to enable and when to disable the command rule. 

George

Marcel van Ek's profile image
Marcel van Ek

George that sample is of no use.. it does not support stacked JES2 events, as the rule only fires ONCE on the first cmd , like this:

Date  TIME     Job Name Evn ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--
11MAR 08:47:29 Q811034  MSG OPS1181O Q811034  OPSS (*Local*) MVS N/A N/A $di1;ti1,c=h;pi1;ti1,c=i                  
11MAR 08:47:29 Q811034  MSG $DI1;TI1,C=H;PI1;TI1,C=I                                                               
11MAR 08:47:29 Q811034  CMD $DI1;TI1,C=H;PI1;TI1,C=I                                                               
11MAR 08:47:29 Q811034  MSG OPS1000J cmd=$DI1;TI1,C=H;PI1;TI1,C=I                                                  
11MAR 08:47:29 JES2     MSG $HASP892 INIT(1)   STATUS=DRAINED,CLASS=H,NAME=1                                       
11MAR 08:47:29 JES2     MSG $HASP892 INIT(1)   STATUS=DRAINED,CLASS=H,NAME=1                                       
11MAR 08:47:29 JES2     MSG $HASP892 INIT(1)   STATUS=DRAINED,CLASS=H,NAME=1                                       
11MAR 08:47:29 JES2     MSG $HASP892 INIT(1)   STATUS=DRAINED,CLASS=I,NAME=1      

So we need to parse the cmd.text on the CMDDELIM char (defaults ;) and then review each command in there. 

Not a big deal and easy to achieve.

Just verified and the reference to JESSTACK sample was already in 11.5 doc (2006!) 

I still have the old 4.4 (and even 4.3!) docs, but they're in bookmanager format which I currently cannot read :) (Edit: i installed IBM Softcopy Reader, and verified, but could not find reference to that sample in there ;0, as far as i can recall, there was no actual 5.1 version so the 11.5 must have been the first one referring it.)

George Liang's profile image
Broadcom Employee George Liang

once the stacked command is parsed to see each command, do you need to reissue the one that is allowed to be processed by a corresponding command rule?

Marcel van Ek's profile image
Marcel van Ek

George, I've not come that far yet.. sofar we just reject the whole string, but i imagine we could adapt cmd.text to remove the prohibited command ? But that might be dangerous/unwanted.. 

E.g: you issue $DI1;TI1,C=X;SI1 

if the TI is prohibited it will start initiator 1 without first changing its settings...  

I know this is a farfetched example, but we need to take that into consideration...

So yes the non prohibited commands should be reissued, but not blindly ;) a WTO will inform the issuer...

Marcel.

George Liang's profile image
Broadcom Employee George Liang

For 'not blindly' , 

yes, agree

Checking can be done in each specific command rule, 

 Or, not to reissue all the individual commands starting from the first prohibited one. 

Or, reject the whole stack command if there's a prohibited one in it. 

 

George Liang's profile image
Broadcom Employee George Liang

Hi, Marcel

Do you have any concern if I propose to remove this sentence in the doc "To implement this type of control logic, see the sample rule JESSTACK in the  CCLXRULS data set."?

Thanks

George

Marcel van Ek's profile image
Marcel van Ek

George: yes if it can no longer be located that would be best...

George Liang's profile image
Broadcom Employee George Liang

Hi, Marcel

As agreed, that sentence in the doc has been removed. 

Thank you!

George