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

228 AppendixA
Parsing Algoithms and User Exit Procedures
“Job Received” Message Exit Procedure
###########################################################
!
! Scans the console record from the host and checks for whether a
! HASP100 (Job Received message) was received from the host. Returns
! reader number, job number and jobname if HASP100 detected.
!
! The format of the console message is as follows:
!
! hh.mm.ss JOB nnnn $HASP100 jobname ON Rxx.RDy username
! JNUM'POS --| | | |
! HASP'POS -------| | |
! JNAME'POS ---------------| |
! RDR'POS ------------------------------------|
!
! All "POS" offsets are byte offset equates. The first byte is
! byte "0".
!
###########################################################
end of comment;
begin ! Local declarations
equate CR = %15, ! Carriage return; scan terminator
BLANK = %6440, ! Blank and CR, for scanning.
ON'RDR'MSG = 1, ! Function return if HASP100 detected.
HASP'POS = 18, ! Location of $HASP100
JNAME'POS = 27, ! Where jobname should be located.
JNUM'POS = 13, ! Location of job number.
RDR'POS = 45; ! Location of the reader number.
byte pointer bptr;
byte array hold(*) = work'area;
define hold'byte = hold(0)#; ! Temp storage for last char of
! record(length).
intrinsic binary;
< **************** Begin Parse'JES2'Console ******************** >
parse'jes2'console := 0; ! Initialize
if length < RDR'POS then ! Don't bother to check if it's not
return; ! long enough.
hold'byte := record(length); ! We don't know what's here, so we'll
record(length) := CR; ! save it and replace it with a known
! character for scanning.
! Scan for the host command char and string "HASP100":
if record(HASP'POS) = "$HASP100" then