Previous Topic: Switch ProcessingNext Topic: Sample Application Under TCF


Displaying Error Messages

At times, you may want to intentionally abend your task by issuing a WRITE LOG statement with a given severity code. To do this under a TCF, perform the following steps:

  1. Move the message number to UCE-MSG-CODE-02.
  2. Move -1 to UCE-RETURN-CODE-02.
  3. Issue a GET STORAGE statement to acquire the storage that is to contain the message text.
  4. Issue a WRITE LOG statement. Include the RETURN TEXT option and specify the previously acquired storage.
  5. Move the address of the message text into UCE-MSG-TEXT-POINTER-02.

    Note: COBOL programs can do this by calling an Assembler subroutine.

  6. Issue a DC RETURN statement.

    This returns control to TCF and displays the error message on the TCF Error Message screen.