Google
 

Trailing-Edge - PDP-10 Archives - tops10and20_integ_tools_v9_3-aug-86 - tools/cbldoc1/msgsre.cob
There are 5 other files named msgsre.cob in the archive. Click here to see a list.
IDENTIFICATION DIVISION.
PROGRAM-ID. MSGSRE.

AUTHOR. D. VISSER.
DATE-WRITTEN. 21-APR-83.
DATE-COMPILED.

************************************************************************
*****
*****		PROGRAM NAME:     PROGEXIT.COB
*****
*****		PURPOSE:          Subroutine to be called by programs to
*****                             handle the run down procedures and 
*****                             generate an error-message.
*****                             On the VAX/VMS this is done by calling
*****                             System Service routine : SYS$EXIT([code]).
*****
*****		NOTES:
*****
*****    The program calling MSGSRE will supply this subroutine with a numeric
*****    string of 3 decimals, in this program called 'MESSAGECODE', which will
*****    contain the value of the message to be generated ( message-code ).
*****    The values will range from 1 to 999 and are divided into different
*****    groups according to the severity-levels. 
*****    These groups are numbered :
*****                               001 - 099 = Fatal-errors
*****                               100 - 199 = Severe-errors
*****                               200 - 299 = Errors
*****                               300 - 299 = Warnings
*****                               400 - 499 = Informationals
*****                               500 - 999 = Success-messages
*****
*****    The calculation of this value into the value of the actual
*****    message-code will be done in this program. To obtain the right
*****    values to address the selected message with, take the following
*****    steps : ( follow the same procedure when adding new messages or
*****    changing the structure of the message source file 'REBILLERR.MSG' )
*****  
*****    - Update the message-source-file REBILLERR.MSG using a editor, adding
*****      as many comment-statements as proper documentation will allow you.
*****      Comment-statements are preceeded by an exclamation mark and can be
*****      placed anywhere in the source-file. ( The exception is the use of
*****      this inside a message-text, where it will be interpeted as a call
*****      to the System Service SYS$FAO utility ).
*****
*****    - Compile the source-file with the listing and LINK the object-file
*****      to create a non-executable message-table REBILLERR.EXE.
*****
*****    - Print the listing and determine the offset-value by taking the 
*****      hexa-decimal value of the first message ( NOT the value for the
*****      facility ! ), subtract hexa-decimal value '8' from this value 
*****      and transfer this value to a decimal value.
*****      $ A == %Xnnnnnnnn <cr>
*****      $ SHOW SYMBOL A <cr> 
*****
*****    - To test if your update works and provides the right messages
*****      you can give the command : '$ SET MESSAGE REBILLERR' and use 
*****      MSGSRETST to enter your offset-value and the message-codes in 
*****      the range from 1 to 999.
*****
*****    - Enter the offset-value hardcoded into this subroutine and
*****      compile it.
*****
*****    Note : The offset in this program won't change if you don't
*****           change the BASE-statements in the message-source-file
*****           and leave the FACILITY-statement unchanged. So there
*****           will be no need to re-compile all the programs in the
*****           system.
*****
*****           Only SYS$EXIT is implemented in this subroutine, which will
*****           exit in all occasions and transfer control to monitor-command
*****           level. Other System Service utilities can be used to 
*****           generate warning- informal- or success-messages so that
*****           control will be handed back to the program. You probably have
*****           to change the USING clause in the PROCEDURE DIVISION.
*****           The severity of the message-code can be determined by the 
*****           value of the MESSAGECODE given to this subroutine.
*****                             
************************************************************************
*****
*****	HISTORY				CURRENT VERSION = 001
*****
*****	VERSION	  DATE	  PROGRAMMER	   CHANGES	
*****	
*****     001  21-Apr-83  D. Visser     Program creation
*****
************************************************************************

ENVIRONMENT DIVISION.

DATA DIVISION.

WORKING-STORAGE SECTION.

77  WK-PROGRAM-NAME             PIC X(8)  VALUE "PROGEXIT".
77  WK-VERSION                  PIC 999   VALUE 001.
77  WK-ERROR                    PIC S9(9) COMPUTATIONAL.
77  WK-OFFSET                   PIC S9(9) COMPUTATIONAL VALUE 134316036.

LINKAGE SECTION.

01  MESSAGECODE                 PIC 999.
PROCEDURE DIVISION USING
                   MESSAGECODE.
A-1.
       
    DISPLAY " ".

    IF MESSAGECODE NOT NUMERIC
        MOVE 1 TO MESSAGECODE.

    COMPUTE WK-ERROR = WK-OFFSET + ( MESSAGECODE * 8 ).

    CALL "SYS$EXIT" USING BY VALUE WK-ERROR.

A-9.
    EXIT PROGRAM.