z/OS JES2 Macros
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


$CWTO – Command processor write to operator

z/OS JES2 Macros
SA32-0996-00

Use $CWTO to cause a write to operator to take place. This macro instruction returns control to the code issuing the macro. The command processor PCE must be in control when you issue this macro instruction. Note that, you cannot use $CWTO in Exit 5 if the exit routine determines that JES2 should process the command. If you use this macro in Exit 5, your routine must do all required processing within the exit. When this processing is completed, your routine must notify HASPCOMM.

See Exit 5 documentation in z/OS JES2 Installation Exits for further details and recommendations.

Be sure to read Usage notes below which describes the interaction of the L=, the JOB=, and the LAST= macro operands and considerations for when a console area is specified on a command processed by Exit 5.

Format description

Read syntax diagramSkip visual syntax diagram
                              .-(--R1--)-.                     
>>-+--------+--$CWTO--MSG--=--+-addr-----+--,L--=--+-value-+---->
   '-symbol-'                 '-'text'---'         '-Rx----'   

>--,MSGID--=--nnnn--+---------------+--+-----------------+------>
                    |       .-NO--. |  |         .-NO--. |   
                    '-,JOB--+-YES-+-'  '-,TRUNC--+-YES-+-'   

>--+----------------+--+----------------+----------------------><
   |        .-NO--. |  |        .-YES-. |   
   '-,LAST--+-YES-+-'  '-,WAIT--+-NO--+-'   

MSG=
Specifies either the address of the text for the message or the text itself. If you specify the text, enclose the character string in single quotation marks ('). If you want the text to include single quotation marks, code two single quotation marks together. In addition, be sure to add the actual message length on the L= keyword.
L=
Specifies either the length, in bytes, of the message text or a register containing the value. The length does not include the extra single quotation mark coded to allow the use of a single quotation mark within the text.
MSGID=
Specifies a 3– or 4–digit decimal number, from 001-9999, to be written out with the message. See z/OS JES2 Messages for message ranges reserved for your use. You must include leading zeros.
JOB=
Specifies whether the WTO is job related. Code JOB= as follows:
YES
The job name and number are inserted in the message. If you specify YES for a multi-line message, you must do so for every line of that message.
NO (default)
The message text remains unmodified.
TRUNC=
 
YES
Any multiple-line WTO is truncated. Additional $CWTO or $CRET macro executions specifying message text result in the issuance of an MGCR or MGCRE. The MGCR or MGCRE treats the message text as a command to JES2.
NO (default)
No truncation takes place.
LAST=
You must code LAST=YES on the last or only line of each message.
YES
Indicates that this is the last line of the multi-line write to operator (MLWTO) and begins a new line. LAST=YES is required for a single line WTO, or to signal the last line of MLWTO.
NO (default)
Indicates that one or more lines of a MLWTO will follow.
WAIT=YES|NO
Specifies the action JES2 is to take if there is no console message buffer (CMB) immediately available for this message. If JES2 is to wait until a CMB becomes available, code YES or omit this parameter. If you want JES2 to return without issuing the message and not wait, code NO.

If you code WAIT=YES or omit WAIT, exit 10, when it receives control, will be told that it can take an action that will result in a $WAIT.

Note: The interaction of the L=, the JOB=, and the LAST= operands, and whether a console area was specified on the command itself, can cause unpredictable results and effects when Exit 5 receives control for a command. JES2 places the console area specification in field COMUCMA. If you do not specify a console area, JES2 sets this field to X'00'. If you do specify a console area, JES2 places the entire command response into a multi-line WTO and ignores any LAST=YES operands on the $CWTO macro instruction.

Usage notes

Use the following guidelines to ensure your command response messages are readable and are not truncated:

  • If a console area is to be used, issue a control line first.

    If a console area is to be used for a command response, JES2 processes the entire response as a multi-line WTO and ignores any LAST=YES operands on $CWTO macro instructions. JES2 places the console area specification for a command in field COMUCMA. If there is no console area, JES2 sets this field to X'00'.

    When a console area is to be used, your first $CWTO is a control line for a multi-line WTO. Since JES2 places a message-id and time stamp at the beginning of a control line, there is only room for you to specify up to 16 characters on the MSG= operand. IBM® suggests you model your message after the $HASP636 message and echo the command in the available 16 characters. Do not code the JOB= or LAST= operands for a control line.

  • Issue the remaining messages structuring your logic to reduce dependencies on whether an area was specified and to provide consistency when displaying job related messages. To do this:
    • Assume each single line and multi-line message will be issued independently as if an area weren't specified, that is, code LAST=YES on a $CWTO for a "single" line message (Remember, it isn't really a single line if an area was specified causing LAST=YES to be ignored.) Similarly, for "multi-line" messages, code LAST=NO on the first and middle lines and LAST=YES on the "last" line.
    • If you code JOB=YES on a multi-line message, code it for each line of that message. For a single or multi-line message with JOB=YES, place the eight character JOBID followed by a blank in the first nine characters of the message text of the first or only message line. If an area wasn't specified, JES2 removes the JOBID from the message text, shifts the remaining text to the left, and issues a WTO with the specified JOBID. If you are issuing a multi-line message, place nine blanks at the beginning of text of the remaining lines.
    • Observe the following line length restrictions to reduce dependencies on whether an area was specified:
      • Place only the JOBID and jobname on the first line of a job related multi-line message, and not more than 25 characters on the first line of a non-job related multi-line message.
      • Limit the length of subsequent message lines to 70 characters if JOB=NO, or 61 characters if JOB=YES.

Environment

  • Main task.
  • $WAIT can occur.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014