SNA NRJE User/Programmer Reference Manual (30292-90006)

224 AppendixA
Parsing Algoithms and User Exit Procedures
Banner Decode Exit Procedure Specification
Example
procedure get'jobnumber(work'area,record,length,cctl,type,jobnumber,
file'num,action);
value length,cctl,type;
logical array work'area; ! In, scratch area.
byte array record; ! In, a line of data (or a PDIR) from
! the host.
integer length, ! In, num bytes in record.
cctl, ! In, carriage control value.
type; ! In, if 0 record is data, if 1 record
! is a PDIR.
byte array job number; ! Out, the host job number.
integer file'num, ! Out, we won't set this.
action; ! Out, also not set.
###########################################################
!
! This procedure will decode a JES2 host banner and return the job
! number. We do not open the output file here but let the NRJE LU
! handle the fopen and fwrites to the output file.
! If we received an "STC" or "TSU" job we return a job number of "-1"
! to cause NRJE to suppress its search of the Job Log (such data sets
! are unsolicited and will not have an entry in the job log).
!
! The banner we are checking looks something like this:
!
! *A START JOB nnnn jobname . . . misc. other information
! |
! |--------- JOB'STRING'POS
!
! The first byte is byte "0", JOB'STRING'POS is a byte offset of
! the string "JOB" or "STC" or "TSU" which is followed by one or
! more blanks and then the job number.
!
############################################################
end of comment;
begin ! Local declarations.
equate JOB'STRING'POS = 9,
DATA'RECORD = 0;
byte pointer bptr;