07/25/87                                                flm(bb)

                           ** Error.Sbr **


       The reasons for writing this subroutine were ;

               1. We needed a nice way to display
                  standard program error codes to
                  the user's terminal.

               2. Track such errors by writing them
                  out to a sequential data file on disk
                  for logging and debugging purposes.


       The arguments and program calling structure is as follows ;

MAP STATEMENTS

       MAP1    ERR'VARS
               MAP2 ERR'0,B,1          - Error number
               MAP2 ERR'1,F            - Error Line Number
               MAP2 ERR'2,F            - Error File Channel
               MAP2 ERR'L,S,1          - Error Log Switch

CALL LABEL

LOG'ERR:        ERR'0 = ERR(0)
               ERR'1 = ERR(1)
               ERR'2 = ERR(2)

               XCALL ERROR,ERR'0,ERR'1,ERR'2

               if only 3 arguments are passed , the error is displayed
               to the user's terminal.

               if you use the following call it will log it to disk
               in a file called 'ERROR.LOG' in the current PPN.

               XCALL ERROR,ERR'0,ERR'1,ERR'2,ERR'L

               The Variable ERR'L is just a null argument that is tested
               right before returning to the basic program.

               if the argument count is equal to 4 then we are going to
               log this error.

               The data written to disk has the following format ;

|------------------------------------------------------------------------------|
| Program Error(12) XCALL subroutine not found Saturday, July 25, 1987 12:51:57
| Job Name : JOBXXX    Terminal : TRMXXX     Program : PROGRM
|  On Line : 00000      Channel : 00000      logged  : DSKX:[P,PN]
|------------------------------------------------------------------------------|