/sys$common/syshlp/HELPLIB.HLB  —  Lexicals  F$MESSAGE  Example
  $ ERROR_TEXT = F$MESSAGE(%X1C)
  $ SHOW SYMBOL ERROR_TEXT
    ERROR_TEXT = "%SYSTEM-F-EXQUOTA, exceeded quota"

      This example shows how to use the F$MESSAGE function to
      determine the message associated with the status code %X1C.
      The F$MESSAGE function returns the message string, which is
      assigned to the symbol ERROR_TEXT.

  $ SUBMIT IMPORTANT.COM
  $ SYNCHRONIZE /entry='$ENTRY'
  $ IF $STATUS THEN EXIT
  $!
  $ JOB_STATUS = $STATUS
  $!
  $ IF "%JOBDELETE" .EQS. F$MESSAGE (JOB_STATUS, "IDENT")
  $ THEN
         .
             .
             .
  $ ELSE
  $    IF "%JOBABORT" .EQS. F$MESSAGE (JOB_STATUS, "IDENT")
  $    THEN
          .
              .
              .
  $    ELSE
  $       .
              .
              .
  $    ENDIF
  $ ENDIF
    .
    .
    .

      This command procedure submits a batch job and waits for it to
      complete. Upon successful completion, the procedure exits. If
      the job completes unsuccessfully, more processing is done based
      on the termination status of the batch job.

      The first command submits the command procedure IMPORTANT.COM.
      In the second command, the SYNCHRONIZE command tells the
      procedure to wait for the job to finish. The third command
      determines if the job completed successfully and, if so, the
      procedure exits. The next command saves the status in a symbol.

      The first IF statement uses F$MESSAGE to determine whether
      the job was deleted before execution. If so, it does some
      processing, possibly to resubmit the job or to inform a user
      via MAIL.

      The next IF statement uses F$MESSAGE to determine whether the
      job was deleted during execution. As a result, some cleanup or
      human intervention may be required, which would be done in the
      THEN block.

      If neither IF statement was true, then some other unsuccessful
      status was returned. Other processing, which would be done in
      the block following the ELSE statement, might be required.
Close Help