HPlogo SNA NRJE User/Programmer Reference Manual: HP 3000 MPE/iX Computer Systems > Appendix A Parsing Algoithms and User Exit Procedures

"Job Received" Message Exit Procedure

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

A description of the exit procedure to parse the console stream for a "Job Received" message is shown below; the message is HASP100 for JES2 and IAT6101 for JES3.

Syntax

                         LA             BA         I          I  
Integer Procedure CON(UserWorkArea, ConsoleRecord, Length, ReaderNum, 
                          BA      BA 
                        Jobnum, JobName) 

Function Return:

Integer (-32768 through 32767). Procedure should return 1 if a "Job Received" message is detected; otherwise, the procedure should return 0.

Parameters

UserWorkArea

Logical array for input/output (of 100 words). This array is initialized to zeros by NRJE, but it is not subsequently modified by NRJE. UserWorkArea can be used for global storage.

ConsoleRecord

An input byte array containing a console message from the host. ConsoleRecord is decompressed and translated into ASCII, using the Native-3000 EBCDIC-to-ASCII translation table.

Length

Input (positive) integer (passed by value). This contains the number of bytes in ConsoleRecord.

ReaderNum

An output integer value (passed by reference). The number of the logical reader (1 through 7) for which the "Job Received" message was received. The exit procedure is responsible for translating the ASCII value of the reader number into an integer value, using the BINARY intrinsic. If the host subsystem is JES3, this value should be set to 0, because JES3 "Job Received" messages do not contain a reader number.

Jobnum

An output byte array (of 4 bytes). Jobnum is initialized to blanks by NRJE prior to each call to the exit procedure. If ConsoleRecord contains the "Job Received" message from the host, Jobnum is to be returned here, left-justified (four bytes maximum).

JobName

Output byte array (of 8 bytes). JobName is initialized to blanks prior to each call to the exit procedure. If the procedure detects a "Job Received" message, it is to return the name of the job to JobName, left-justified.

Description

The procedure is identified in the NMMGR Workstation Data screen. If the procedure is not specified, an internal algorithm is used to parse the message. This algorithm will work unless the host job entry subsystem has been modified.

If the procedure detects a "Job Received" message from the host, it is to return the integer value of 1 and the corresponding job number and job name. Any other function return value ( 1) is ignored by NRJE. The procedure is called by the NRJELU in user mode, with traps on. The NRJELU is prepped with IA, BA, DS, MR, PH, and PM capabilities. An example of a console exit procedure in SPL to parse a JES2 HASP100 message is shown below.

Example

integer procedure parse'jes2'console(work'area,record,length,
                                     rdr'num,job number,jobname);
value length;
 
logical array work'area;        ! In, scratch area.
 
byte array record;              ! In, the console record.
 
integer length,                 ! In, positive byte count of record.
 
        rdr'num;                ! Out, range 1 to 7 if HASP100                                ! detected.
 
byte array job number,          ! Out, set if HASP100 detected.
 
           jobname;             ! Out, set if HASP100 detected.
 
comment
###########################################################
!
! 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
  begin                                   ! It's a hit!
 
    ! Need to skip leading blanks, if any, so that what we return is
    ! left justified.
 
    scan record(JNAME'POS) while BLANK,1;
    @bptr := tos;
    move jobname := bptr,(scan bptr until "  "); ! Move until blank.
    scan record(JNUM'POS) while BLANK,1;
    @bptr := tos;
    move job number := bptr while N;       ! Move while numeric.
    rdr'num := binary(record(RDR'POS),1);
    parse'jes2'console := ON'RDR'MSG;
  end;
 
! Now put that "hold" byte back:
 
record(length) := hold'byte;
 
end;              ! Parse'JES2'Console.
Feedback to webmaster