Previous Topic: MOVE StatementNext Topic: Procedure


NOTIFY Statement

The NOTIFY statement transmits data or a message to the message line in an online or batch environment. You can also send the message to the operator console. NOTIFY is useful for displaying a message with information about errors, instructions to continue, warnings, and so on, to the user's or operator's terminal.

This statement has the following format:

NOTIFY list_specification [TO CONSOLE]
list_specification

Specifies the data to transmit. The format is as follows:

{flag                   }[    flag                    ]
{numeric_field          }[    numeric_field           ]
{date_field             }[[,] date_field              ] ...
{alphanumeric_expression}[    alphanumeric_expression ]

For more information about flag fields, numeric fields, date fields, and alphanumeric expressions, see the PDL Language concepts topic in the "Procedure Definition Language Concepts and Language Elements" chapter.

TO CONSOLE

The CONSOLE clause lets the application send a message to the operator console. The message is also sent to the z/OS JESLOG or VSE POWER LOG in batch or to the CICS System Message Block online.

The NOTIFY message is sent from the program to the message line when the next TRANSMIT statement executes. If there are multiple NOTIFY statements, only the last NOTIFY message before the TRANSMIT is sent.

The NOTIFY message is cleared from the message line when the next statement in the program executes after the TRANSMIT. If no TRANSMIT occurs between NOTIFY and the end of a run, the message appears on the next CA Ideal system panel. In this instance, the NOTIFY message overrides the RUN COMPLETED message.

If the TO CONSOLE clause is used, the message is sent to the operator's console when the NOTIFY statement is executed.

The maximum length of a NOTIFY message is 79 characters. The maximum length of a NOTIFY message sent to a console is 72 characters.

A nullable data item with a value of NULL is shown as a question mark (?) or the character specified using the SET REPORT NULLSYM command.

Example

The following example transmits a user panel (USRPANEL) in a loop and performs a <<CHECK_ERRORS>> procedure that verifies field information.

The PNL_SSN field is checked to allow only numeric characters. If an error is found, the ERRORS field is updated and the NOTIFY statement holds this message to send with the next TRANSMIT statement.

The EMP_NUM field is checked to allow only numeric characters. If an error is found, the ERRORS field is updated and the NOTIFY statement holds this message to send with the next TRANSMIT statement.

Only the last NOTIFY message is sent for each TRANSMIT. In this example, NOTIFY eliminates the need for a separate message field in USRPANEL.

<<NOTIFYEX>> PROC
      SET ERRORS EQ 1
      LOOP UNTIL ERRORS = 0
          TRANSMIT USRPANEL
          DO CHECK_ERRORS
      ENDLOOP
ENDPROC
<<CHECK_ERRORS>> PROC
      SELECT FIRST ACTION
      WHEN NOT $VERIFY(PNL_SSN, AGAINST = NUMERIC)
          SET ERRORS = ERRORS + 1
          NOTIFY $STRING(PNL_SSN, ' INVALID SSN')
      WHEN  NOT $VERIFY(PNL_EMP_NUM, AGAINST = NUMERIC)
          SET ERRORS = ERRORS + 1
          NOTIFY $STRING(PNL_EMP_NUM, ' INVALID EMP_NUM')
      WHEN OTHER
          SET ERRORS = 0
      ENDSELECT
ENDPROC