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

Parsing Algorithms

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

To route output properly, SNA NRJE must parse both "Job Received" messages (such as the $HASP100 message from JES2) and host system output banner pages of the received data sets. This capability is necessary for NRJE to be able to interpret the host system job number. This chapter describes the algorithms used to perform the parsing. The algorithms work for all host messages and banners which have not been modified by host system programmers. If nonstandard "Job Received" messages or host banners are sent to your workstation, an exit procedure might be needed to parse for the necessary information. The user exits and exit procedure specifications are described in this chapter.

NOTE: If you are connected to a JES3 host system, NRJE does not use an internal banner decode routine. For both print and punch output, the job number is returned from the host in the spin number field of the PDIR.

VSE/POWER does not send "Job Received" messages.

If a user-written banner decode exit procedure is not in use, these rules apply for host banner translation:

  • Print Output

    If the configured Language ID is 0 to 255, NRJE translates the banner by using the EBCDIC-to-ASCII translation table for the indicated language. If set to BINARY (-1 translation code), NRJE assumes it is an EBCDIC banner and will attempt to parse the banner accordingly. Printer banners are always written to the output file, translated according to the configuration for the writer. (If "no translation," the banner is written without translating.)

  • Punch Output

    NRJE attempts to parse only those records which are preceded by a Job Separator PDIR (PDIR byte 3 = 1). For additional information, see "Peripheral Device Information Record" in Chapter 4 “Job Output” The records are assumed to be in Hollerith regardless of the language ID configuration field for the logical writer. You can configure NRJE to assume either Hollerith or EBCDIC banners on the NMMGR Workstation Data Page 2 screen. If NRJE fails to obtain a host job number from the banner, it translates the banner card according to the language ID configuration for the writer. Punch banners are always written to the output file, unless the output was received on reserved form CMD. NRJE will not print the punch banner for output directed to the formid CMD, even if the output was redirected by the user with the SUBMIT command.

"Job Received Message" Parsing Algorithm

The algorithms used by NRJE to parse JES2 or JES3 "Job Received" console messages are shown below. Output variables are JobNumber, ReaderNumber, and JobName.

JES2 Algorithm

scan buffer for host'command'char;
if found and host'command'char followed by "HASP100" then begin
      scan from buffer(0) for keyword "JOB"
      skip trailing blanks;
      move to JobNumber variable while numeric;
      skip all blanks trailing "HASP100" string;
      move 8 characters to JobName variable;
      scan from jobname'position for period;
      skip two characters and assign ReaderNumber variable;
    end;

JES3 Algorithm

begin
  scan for "IAT6101";
  if found scan for "JOB";
  if found skip trailing blanks;
  move to JobNumber while numeric;
  scan for string " IS ";
  skip trailing blanks;
  move to JobName for 8 characters;
  ReaderNumber := 0;        ! They are not in JES3 messages.
end;
NOTE: If a "Job Received" message algorithm detects an IAT6101 message, NRJE checks each active reader for a match with JobName to associate the JobNumber with the correct job. If two jobs are active on two readers at the same time with the same JobName, correct output routing cannot be guaranteed.

VSE/Power

Power does not send "Job Received" messages.

Banner Decode Parsing Algorithms

The algorithms used by NRJE to parse JES2 output banner pages are shown below. JES3 obtains host job numbers from the spin number field of the PDIR. No attempt is made by NRJE to decode output banners from VSE/POWER.

JES2 Algorithm

scan buffer for one of three keywords: "JOB" or "STC" or "TSU";
if found then skip trailing blanks;
if "JOB" found then
   move while numeric to JobNumber variable
else
   if "STC" or "TSU" found then
     JobNumber := "-1";
NOTE: A JobNumber value of -1 indicates that the output is unsolicited and that the Job Log should not be checked for routing information.

Punch Banner Decode Algorithms

The algorithm used by NRJE to parse punch output banners for data sets returning from JES2 is shown below.

Translate first line of output using Hollerith table:
     %160 (hex 70):               to ASCII "0";
     %221 - %231 (hex 91 to 99):  to ASCII digits "1" through "9"
     all other characters:        to ASCII blank " ";
begin
  translate from Hollerith to ASCII;
  skip leading blanks;
  for digit'count 0 to 7 do
    begin
      outnum(digit'count) := this'char;
      scan while this'char;
      skip trailing blanks;
      digit'count := digit'count + 1;
    end;         { For digits 0 to 7}
  if digit'count =4
    then offset := digit'count - 4
  move jobnumber  := outnum(offset) , (4 bytes);
end;             { Parse punch banner }
Feedback to webmaster