Download as pdf or txt
Download as pdf or txt
You are on page 1of 76

IBM 4690 Electronic Journal

(5799-QXL)

Guide to Operations

Document Version 1.2

Created on 6/6/97

1 Created 6/6/97
Second Edition (May, 1997)
This is the second edition of the IBM 4690 Electronic Journal Guide to
Operations. This edition applies to the 4690 Electronic Journal PRPQ 5799-QXL
and to all subsequent releases and modifications until otherwise indicated in
new editions. This edition was created on 6/6/97.

© Copyright EDJ Enterprises, Inc. 1996, 1997. All rights reserved.


© Copyright International Business Machines 1996, 1997. All rights
reserved.

Note to U.S. Government Users -- Documentation related to restricted rights --


Use, duplication or disclosure is subject to restrictions set forth in GSA ADP
Schedule Contract with IBM Corp.

IBM and OS/2 are the registered trademarks of International Business Machines
Corporation.
Windows is a trademark of the Microsoft Corporation.
Table of Contents

Chapter 1 IBM 4690 Electronic Journal - Overview 1-1


Application Features 1-1
Application Functions 1-1
Sizing Information 1-2
Off-line Operations 1-3
System Requirements 1-4
Installation 1-4

Chapter 2 IBM 4690 Electronic Journal - Personalization Options 2-1

Chapter 3 IBM 4690 Electronic Journal - Tailoring Options 3-1

Chapter 4 IBM 4690 Electronic Journal - Journal Review 4-1


REVIEW Journal Selection 4-1
Journal Display Panel 4-4
Basic Journal String Search 4-5

Appendix A IBM 4690 Electronic Journal Integration A-1


(IBM 4680/4690 Terminal Applications) A-1
Electronic Journal Feature User Exits A-2
General Sales Application A-3
Programming Information for GSA A-7
Supermarket Application: A-8
Programming Information for Supermarket Application A-14

i Created 6/6/97
V1R0 IBM 4690 Electronic Journal ii
Created on 6/6/97
Chapter 1 IBM 4690 Electronic Journal - Overview
Application Features

The IBM 4690 Electronic Journal PRPQ (5799-QXL) for the IBM 4690 Point of
Sale system is designed to provide fast access to store level transaction data for
the sales audit staff and the store manager at the store level.

The features of 4690 Electronic Journal include:

• Electronic data journal to reduce or eliminate paper journal roll usage


by the store.
• Electronic data journal to reduce print head wear on the register.
• Paper journal prints automatically when the register is off-line to the store
controller.
• Electronic data journal capture selected by register.
- Electronic Journal only.
- Paper Journal only.
- Both Electronic and Paper Journals.
• Journal file content is identical to a printed paper journal roll.

Application Functions

The IBM 4690 Electronic Journal is tailored for your store system through a
series of responses to questions.

The point of sale registers are personalized through a series of panels. There
are store options and terminal options to be specified.

The store options relate to where the journal data is kept and for how long. The
number of days of information kept in the electronic data journal files is a user-
specified parameter. Practical limitations on the number of days saved may be
imposed by the size of the store controller's hard disk files. The application also
provides the ability to compress journal files to take less space. The user can
specify when to trigger the compression of journals automatically. If a journal is
later retrieved for review, it is de-compressed before use.

V1R0 IBM 4690 Electronic Journal 1-1


Created on 6/6/97
The terminal options relate to the journal options for each register. The user
specifies a default terminal option that can be overridden for individual registers.

The IBM 4690 Electronic Journal application provides an electronic journal


function for the register sales application. When the electronic journal function
is enabled, instead of printing on the register's journal roll, the journal data is
captured in the register and saved in a store controller disk file. The electronic
journal data is immediately available for review after the completion of the
transaction. This journal data is separate from the transaction log maintained by
the system.

The electronic journal is selected by date and register number for review. The
program provides scrolling capability to swiftly move through a journal file. The
selected journal can be reviewed as selected, or the user can then use a string
search to locate specific items of interest in the journal.

Sizing Information

The IBM 4690 Electronic Journal application captures the journal image before it
is printed and saves the ASCII image in the Electronic Journal file. Each register
has a separate electronic journal file for each day of activity. The size of the file
is dependent on how many transactions were performed during the day, and
how many print lines were issued for each transaction.

A simple rule of thumb to determine the size of the file for any specific register
would be:

(Number of feet of journal roll used on an average or peak day) x 72 x 40.

This calculation would provide an estimate of the number of bytes of data


that need to be stored. Multiplying by the number of registers would give
the total file size needed for the day.

V1R0 IBM 4690 Electronic Journal 1-2


Created on 6/6/97
Off-line Operations

Off-line has different definitions depending on whether your store has a single
controller or uses the multiple controller feature. In a single controller
environment, off-line means that the register is out of communication with the
controller.

In a multiple controller environment, it is possible for a register to be off-line to


the File Server, but still be online to either the Alternate File Server or another
controller on the LAN. In these cases, it is not possible to update the Electronic
Journal which resides on the File Server.

If a register is off-line to the File Server, the electronic journal for all transactions
that occur may be spooled to the local controller. When this controller next has
access to the File Server (or becomes the File Server) the local electronic
journal transactions will be despooled into the master copy of the journal.

If a register is off-line to all controllers, journaling operations differ depending on


the register’s printer. The IBM 4610 printer has memory built into the printer.
This memory is used when the register is off-line to hold the journal information
until the register is back online. When the register returns to online status, the
transactions in the printer’s memory are sent across to the store controller.

Other IBM 4690 printers (Models 1 to 4) have a journal station and no internal
memory. In this case, the journal tape is printed automatically when the register
is off-line to the store controller. The decision to print or not print on the journal
is made at the end of the transaction. If the register is online when the
transaction is started, but goes off-line during the transaction, the complete
transaction is printed on the journal roll for security and audit purposes. If the
register comes online during a transaction, the current transaction will not be
printed on the register's journal roll because as far as the register is concerned, it
is online at the critical time.

V1R0 IBM 4690 Electronic Journal 1-3


Created on 6/6/97
System Requirements

IBM 4690 Electronic Journal PRPQ executes on both 4680 and 4690 platforms.

Operating Systems:

• IBM 4690 OS, Version 1 5696-538

Application Systems:

• IBM 4680 Chain Sales Application 5669-212


• IBM 4680 Supermarket Application 5669-032
• IBM 4680 General Sales Application 5669-031
• IBM 4680 Specialty Sales Application 5799-CRC

• IBM 4680-4690 Supermarket Application 5696-536


• IBM 4680-4690 General Sales Application 5696-546

Installation

The README file on the first installation diskette contains information on how to
install the Electronic Journal feature. Print the file and perform the steps
indicated to complete the installation. Make sure you check the log for any error
messages as indicated in the README file, and resolve any errors logged.

When you have complete this successfully refer to Appendix A (Electronic


Journal Integration) and follow the instructions to incorporate the required
changes to your POS Terminal application.

V1R0 IBM 4690 Electronic Journal 1-4


Created on 6/6/97
Chapter 2 IBM 4690 Electronic Journal - Personalization
Options
The IBM 4690 Electronic Journal PRPQ allows the user to customize the
operation of their system. Users provide the option information in a file down-
loaded from their host system, or through the personalization panels in the store.

The personalization options are divided into store options and terminal options.
The store options are used to specify information about the journal files. The
terminal options are used to specify information about the registers and the type
of journals desired. There are application default settings used if the options file
is not updated by the user. The terminal options for register 000 are used to
provide the defaults for the entire store’s registers. Choosing a specific register
number will set the options only for that particular terminal.

From a secondary application menu, select the "IBM 4690 Electronic Journal
Personalization" option. The following panel is displayed. F3 is used to exit the
process.

EJSCRN30 ELECTRONIC JOURNAL PERSONALIZATION

Select one of the following:

1. Store Options
2. Terminal Options

Type your selection number. 1

For Terminal Options, type the


terminal number to be processed. 000

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

V1R0 IBM 4690 Electronic Journal 2-1


Created on 6/6/97
If the user picks Store Options, the following panel is displayed.

EJSCRN31 STORE OPTIONS

Type the following information.

Days worth of journals to save ==> 0


Days before compress ==> 0

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

The user supplies the requested information for each of the fields.

Days of journals to save This parameter defines the number of days of


electronic journal files that the system keeps. Journal
information is automatically purged when the time
elapses.

Days before compress To save space, 4690 Electronic Journal automatically


compresses the journal files. This parameter is used
to specify how many uncompressed days worth of
data should be kept on the system. The current day
is always uncompressed. When data is compressed,
it must be de-compressed prior to displaying, which
will slow down this function.

After the options have been selected, press ENTER to update the options file.

V1R0 IBM 4690 Electronic Journal 2-2


Created on 6/6/97
If the user picks Terminal Options, the following panel is displayed.

EJSCRN32 TERMINAL OPTIONS

Type the following information.

Type of Journal for this terminal ==> 3


1 Electronic Only
2 Paper Only
3 Both Paper & Electronic

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

The user supplies the requested information for each of the fields.

Type of Journal The user has three options for normal journal entries.
1 = Electronic Only means that journal information is
only saved electronically.
2 = Paper Only means that journal information is
printed and there is no electronic copy to access.
3 = Both Paper & Electronic means the register
provides both hard copy and an electronic copy
of the journal information.

After the options have been selected, press ENTER to update the options file.

The options can then be activated in one of the following ways:

1. For the options to take place immediately:


Stop and restart the background application QXLSERVER.
Reload the terminal application.
2. The new options will take effect automatically at the beginning of
the next day.

V1R0 IBM 4690 Electronic Journal 2-3


Created on 6/6/97
V1R0 IBM 4690 Electronic Journal 2-4
Created on 6/6/97
Chapter 3 IBM 4690 Electronic Journal - Tailoring
Options
The IBM 4690 Electronic Journal PRPQ allows the user to tailor the operation of
the system. Users provide the option information through the tailoring panels.

The tailoring options are designed to lead the user through the process of
gathering the information that is important to the installation of the application.
Tailoring allows the application to interface with a wide variety of environments.

On the Command Line of the 4690 operating system, type QXLTAYLR and press
ENTER. The following panel is displayed. F3 is used to exit the process.

EJSCRN50 TAILOR ELECTRONIC JOURNAL FEATURE

Type the following information:

Journal Session Number ==> 99

Do you use MCF? ==> N

Do you use 4610 Printer? ==> N

Do you use Medium Model in your Terminal Sales Application?

==> N

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

The user supplies the requested information for each of the fields.

V1R0 IBM 4690 Electronic Journal 3-1


Created on 6/6/97
Tailoring parameters and default values.

Journal Session Number Default = 99.


This parameter represents the session ID number for
use by the application when referring to the journal
data file.
(Assign a number that does not conflict with
application session numbers.)

Do you use MCF? Default = N.


If the store uses the 4690 operating system’s multiple
controller feature, the correct response is Y. This is
information that the application uses to identify the
execution environment and available resources for
off-line conditions.

Do you use 4610 Printer? Default = N.


If the registers have the IBM 4610 printer attached,
the correct response is Y.
In off-line conditions, the memory in the 4610 printer
is used instead of a printed copy of the journal data.
Use N if the registers have the normal POS printers
(Models 1 to 4).

Do you use Medium Default = N.


Model in your Terminal This information is used to suggest the appropriate
Sales Application? modules to be linked together for the terminal sales
application with electronic journal.

The next panel displays if the user selects MCF=Y and presses ENTER.

V1R0 IBM 4690 Electronic Journal 3-2


Created on 6/6/97
EJSCRN51 TAILOR ELECTRONIC JOURNAL FEATURE

Specify an available Pipe ID ==> F

When a terminal is off-line to the file server how do you want to


handle the journal? Select one of the following options:

1 Treat the journal as if the terminal was not online


to any controller.

2 Save the journal on the local controller and despool


them to the file server when it comes back online.

Option selected ==> 2

If you selected Option 2, specify 3 register session numbers:

Control File Session ==> 91 Spool Session ==> 92 DeSpool Session ==> 93

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

The user supplies the requested information for each of the fields.

Available Pipe ID. If MCF = Y,


then a Pipe ID needs to be provided for register to
controller communications.
The Pipe ID selected should be unique.

In a single controller environment, a register is either online or off-line to the


store controller. It is a straight forward logical determination.

In a multiple controller environment, it is possible for a register to be off-line to


the File Server, but still be online to either the Alternate File Server or another
controller on the LAN. In these cases, it is not possible to update the Electronic
Journal which resides on the File Server. The Electronic Journal is a Mirrored
file, however, we do not use the WRITE MATRIX function to write to it.

If a register is off-line to the File Server, the electronic journal for all transactions
that occur may be spooled to the local controller. When this controller next has
access to the File Server (or becomes the File Server) the local electronic
journal transactions are despooled into the master copy of the journal.

V1R0 IBM 4690 Electronic Journal 3-3


Created on 6/6/97
If a register is off-line to all controllers, the journal for the off-line transactions will
be written on the paper journal unless the printer is an IBM 4610 printer.

Off-line Options:

Terminal Off-line Option. Default = 1.


Option 1 means that the terminal is considered totally
off-line from all store controllers.
Forces printing of the journal if journal printer station
is available.
Uses memory in the IBM 4610 printer if available.
Option 2 checks to see if a local controller is
available for temporary storage of the journal files.
If a local controller is available, journal spooling takes
place. This requires the assignment of additional
session numbers.

Control File Session Default = 0.


(No local controller available for off-line spooling.)
If a local controller is available, assign a unique
session number for the Control File.

Spool Session Default = 0.


(No local controller available for off-line spooling.)
If a local controller is available, assign a unique
session number for the Spool Process.

DeSpool Session Default = 0.


(No local controller available for off-line spooling.)
If a local controller is available, assign a unique
session number for the DeSpool Process.

In order to have transactions spooled to the local controller, it is necessary to


select Option 2 and specify three session numbers to be used. If you do not
want spooling to occur, select Option 1 and set these session numbers to zero
(0). Without spooling, any transactions that occur are treated as if the register is
off-line to all controllers.

V1R0 IBM 4690 Electronic Journal 3-4


Created on 6/6/97
If the user selected Meidum Model, this panel is displayed when ENTER is
pressed.

EJSCRN54 TAILOR ELECTRONIC JOURNAL FEATURE

Type the following information:

Maximum number of electronic journal lines per transaction ==> 100

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

Maximum Number of Default = 0.


Electronic Journal Lines Setting a maximum number of lines to occur in any
per transaction. electronic journal transaction allows the program to
request the largest block of memory that it will need
during the day.
This is important when the terminal application is
compiled with the medium memory model.
If a transaction has more lines than specified in this
parameter, it is truncated on the journal file.
0 implies no limit.

V1R0 IBM 4690 Electronic Journal 3-5


Created on 6/6/97
After the user completes entry of the information and presses ENTER, the
following panel is displayed.

EJSCRN53 TAILOR ELECTRONIC JOURNAL FEATURE

Based on your selections use the following L86 file to link


your terminal sales application: EJL1LIBR.L86

You selected the following options:

MCF in use ==> Y

4610 Printer ==> Y Available Pipe ==> F

Medium Model ==> Y Max lines per XTN ==> 100

You selected the following session numbers to be used in your terminal:

Journal Session ==> 90

Control Session ==> 91 Spool Session ==> 92 DeSpool Session ==> 93

To save these options, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

The user can review the options that they have chosen. If there is a conflict with
any of the choices, an error message is displayed. From the error message
panel, the user returns to the first panel in the process.

V1R0 IBM 4690 Electronic Journal 3-6


Created on 6/6/97
Chapter 4 IBM 4690 Electronic Journal - Journal Review
The electronic journal function of IBM 4690 Electronic Journal PRPQ captures
the journal information in the register application at the point where the data
would normally be printed. The information is stored in a group of files in the
store controller by register and by date. The journal information is available for
review immediately after it is written to the controller file.

IBM 4690 Electronic Journal provides a journal review program that makes it
easy to look at the information contained in a journal.

REVIEW Journal Selection

REVIEW Journal Selection

EJSCRN20 PROCESS SINGLE JOURNAL

Select one of the following:

1 Display Journal
2 Print Journal
3 List Journal, by Date
4 List Journal, by Register

Type your selection number. 1

Type the date. 05/20

Type the terminal number. 001

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

V1R0 IBM 4690 Electronic Journal 4-1


Created on 6/6/97
If the user knows which journal they need to review, they can directly select the
journal by supplying the date and the register number.

If the user does not know which register journals are available, selections 3 and
4 will provide this information either by register number or activity date.

The user can select either to display the journal or to print a hard copy on the
store controller printer. If the user elects to display the journal, a function key on
the displayed report will allow the user to print a copy after review.

The information panels are shown next.

Journal List by Date

JOURNAL LIST, BY DATE Page 1

Hi-lite selection, then hit F-key to perform function.


04/27 001

04/28 001
002
003

05/01 001
003
005

05/02 001

F1 F2 F3 QUIT F4 PRINT F5 DISPLAY


F6 F7 F8 F9 F10

V1R0 IBM 4690 Electronic Journal 4-2


Created on 6/6/97
Journal List by Register

JOURNAL LIST, BY TERMINAL Page 1

Hi-lite selection, then hit F-key to perform function.


001 04/27
04/28
05/01
05/02

002 04/28

003 04/28
05/01

005 05/01

F1 F2 F3 QUIT F4 PRINT F5 DISPLAY


F6 F7 F8 F9 F10

V1R0 IBM 4690 Electronic Journal 4-3


Created on 6/6/97
Journal Display Panel

Journal Display Panel

$JJ:428095 Line 1 of 70
100 % read...
--------------------------------------
1453 LAYAWAY 3174 0016 003
LAYAWAY OPENED ON 4/28/95
ACCOUNT 20925
1458- -1457 MDS 1 99.99
1451- -1457 MDS 1 25.00
LAYAWAY FEE 2.00
SUBTOTAL 126.99
4.5% VA.SALES TAX 5.62
TOTAL 132.61
DEPOSIT 32.61
CASH TENDER 32.61
LAYAWAY BAL DUE 100.00
001290830000076150001133200000012409

ATTN: SIGNED ON IN ZONE 04

F1 F2 F3 QUIT F4 PRINT F5
F6 F7 F8 F9 REPEAT F10 SEARCH

Once the user has selected the individual journal for review, 4690 Electronic
Journal reads the journal information and formats the report for display. The
following keys are active to facilitate journal review:

Home Sets the display to show the first line of the


report at the top of the panel.
End Sets the display to show the last line of the
report at the bottom of the panel.
PageUp Moves the displayed report up eighteen lines
at a time.
PageDown Moves the displayed report down eighteen
lines at a time.
ArrowUp/Down Moves the displayed report up or down one
line at a time.

If the user presses F4 while the report is displayed, a hard copy of the entire
journal is sent to the store controller's printer.

If the user presses F10 to initiate a search, the following panel is displayed.

V1R0 IBM 4690 Electronic Journal 4-4


Created on 6/6/97
Basic Journal String Search

$JJ:428095 Line 1 of 70
100 % read...
--------------------------------------
1453 LAYAWAY 3174 0016 003
LAYAWAY OPENED ON 4/28/95
ACCOUNT 20925
1458- -1457 MDS 1 99.99
1451- -1457 MDS 1 25.00
LAYAWAY FEE 2.00
SUBTOTAL 126.99
4.5% VA.SALES TAX 5.62
TOTAL 132.61
DEPOSIT 32.61
CASH TENDER 32.61
LAYAWAY BAL DUE 100.00
001290830000076150001133200000012409

ATTN: SIGNED ON IN ZONE 04

Search String: __________________________


F1 F2 F3 QUIT F4 PRINT F5
F6 F7 F8 F9 REPEAT F10 SEARCH

The % read indicator in the upper righthand portion of the panel shows how
much of the journal has been read into memory. For fast access, only a portion
of the journal is read and displayed. As more of the journal is requested by
paging operations, more of the journal is read. This is a productivity feature.

The user can enter a string of characters to match during the search operation.
The character string is not case-sensitive, which means that upper- and
lowercase letters are treated the same. The user presses the ENTER key after
keying the character string. The program then searches for the next occurrence
of the string data. The journal display is refreshed with the matching information
shown on the first data line of the display.

By pressing the F9 key, the same search can be repeated multiple times. The
character string is not automatically reset to allow the user to page through the
entire journal.

If no matching condition is found, the following message is displayed.

"END OF FILE REACHED WITHOUT FINDING MATCH"

V1R0 IBM 4690 Electronic Journal 4-5


Created on 6/6/97
V1R0 IBM 4690 Electronic Journal 4-6
Created on 6/6/97
Appendix A IBM 4690 Electronic Journal Integration
(IBM 4680/4690 Terminal Applications)

Overview

The IBM 4690 Electronic Journal Feature must be integrated into your POS
terminal application. At the appropriate points in your application you must
insert calls to the entry points in the Electronic Journal Feature. If you use the
General Sales Application or the Supermarket Application these calls are
inserted in your terminal user exits. If you use the Chain Sales Application, then
changes to the source are required.

Once you have changed and re-compiled the appropriate terminal sales
application modules you must re-link your terminal sales application with an
Electronic Journal Link Library.

The Electronic Journal Feature also provides a User Exit module. When you
link your terminal sales application you must include an object module for the
User Exit Module.

V1R0 IBM 4690 Electronic Journal A-1


Created on 6/6/97
Electronic Journal Feature User Exits

The Electronic Journal Feature provides two user exits:


QXLEXIT1 and QXLEXIT2.

The ‘Journal’ function calls QXLEXIT1, before it adds a line to the electronic
journal. This gives the user the opportunity to modify the text before it is saved.
If a null string is returned then this line will not be included in the electronic
journal at all.

The interface for QXLEXIT1 is:

FUNCTION QXLEXIT1(PrintLine) PUBLIC


STRING QXLEXIT1, PrintLine

QXLEXIT1 = PrintLine

FEND

The ‘Journal’ function calls QXLEXIT2, after it adds a line to the electronic
journal and before it returns to the caller. The purpose of this exit is to allow you
to force the line to be printed on the paper journal regardless of the print option
you selected for this register. The default is not to print the line. If QXLEXIT2
returns anything other than a null string, then the line of information is printed on
the physical journal. The default QXLEXIT2 code is:

INTEGER*1 GLOBAL PaperOn


FUNCTION QXLEXIT2(PrintLine) PUBLIC
STRING QXLEXIT2, PrintLine

QXLEXIT2 = ""
IF PaperOn THEN QXLEXIT2 = PrintLine

FEND

V1R0 IBM 4690 Electronic Journal A-2


Created on 6/6/97
General Sales Application

Insert Hooks for Electronic Journal Feature

On one of the Integration diskettes you will find a directory named “EAL”, which
contains the following GSA User Exit modules:

EALTSU06.BAS
EALTSU15.BAS
EALTSU16.BAS

You may copy these files into your development directory. You must either use
these user exits or integrate their contents into your version of the user exit. Be
careful copying the sample user exits onto your system since you may overlay
your system’s user exits.

If you do not use the source files provided with the Electronic Journal Feature,
do the following:

1. In module EALTSU06, insert the following code before the FUNCTION


PRINT.EXIT$ statement:

FUNCTION Journal(prt.line$) EXTERNAL


STRING Journal,prt.line$
FEND

FUNCTION Journal.Before(line.type,prt.line$) EXTERNAL


STRING Journal.Before,prt.line$
INTEGER*2 line.type
FEND

FUNCTION Journal.After(line.type) EXTERNAL


INTEGER*2 line.type
FEND

2.
In module EALTSU06, insert the following code after the
FUNCTION PRINT.EXIT$ statement:

ON.ENTRY.TO.EXIT:
IF sta.sess.id = 23 THEN CALL Journal.Before(line.type,prt.line$)
START.EXIT.PROCESSING:

V1R0 IBM 4690 Electronic Journal A-3


Created on 6/6/97
3. In module EALTSU06, insert the following code before
PRINT.EXIT$=PRT.LINE$ statement:
FINISHED.EXIT.PROCESSING:
IF sta.sess.id = 23 THEN prt.line$ = Journal(prt.line$)
IF sta.sess.id = 23 THEN CALL Journal.After(line.type)

The ‘Journal’ function puts the information in the electronic journal, and
determines whether the data needs to be printed on the physical journal. If
the Journal function returns a null, then the data does not need to be printed,
otherwise it does.

4. In the module EALTSU15, insert the lines that appear in bold text.

%ENVIRON T
FUNCTION CheckJournalFile EXTERNAL
FEND
FUNCTION CHECK.OFFLINE external
FEND
FUNCTION TRAN.TO.EXIT PUBLIC
INTEGER*2 TRAN.TO.EXIT
call checkjournalfile
call CHECK.OFFLINE
END FUNCTION

5. In the module EALTSU16, insert the lines that appear in bold text.
Substitute the session number that you want the IBM 4690 Electronic Journal
to use for option files.

%ENVIRON T
INTEGER*2 GLOBAL QXL.SESSION

FUNCTION FILE.OPEN.EXIT PUBLIC


INTEGER*2 FILE.OPEN.EXIT ! Define function type

QXL.SESSION = 89 ! This session number will be used


! for controller disk files, including opt files.
! It needs to be unique.
END FUNCTION

V1R0 IBM 4690 Electronic Journal A-4


Created on 6/6/97
Link Terminal Sales Application

Once you have re-compiled EALTSU06, EALTSU15, and EALTSU16, re-link


your terminal module with QXLEXITS and with the Electronic Journal L86 file
that contains the features that you plan to use. The L86 files for GSA are in the
EAL directory on one of the Integration diskettes. If you perform the Tailoring
function it will tell you, based on your feature selections, which L86 file to use.

Copy the QXL*.* files from the root subdirectory of the first Integration Diskette
into the ADX_UPGM directory. From the EAL subdirectory copy the correct L86
files from the chart below (previously identified by executing the steps identified
in Chapter 3).

Add to your INP file an entry for QXLEXITS and an entry for the L86 file you
have chosen. Issue the LINK86 command to link your terminal application.
Follow this with a POSTLINK command.

After linking and postlinking, copy the terminal load file to ADX_IPGM and
distribute the file (compound on close) if using a Local Area Network (LAN). This
must be done for all applications.

NOTE: Separate libraries are provided as a mechanism to reduce the amount of


memory used by the Electronic Journal feature. For example, if you have 1-MB
terminals in a single controller environment with Model 2 printers, you will
significantly reduce the size of the electronic journal code by linking with
EALEJNNM.L86. In that same environment you could also link with
EALEJPLM.L86. The function would be identical, but more code space would be
used.

The L86 files are:

Memory Model File Name Features


Medium EALEJNNM Electronic Journal
Medium EALEJPNM Electronic Journal
4610 Printer Support
Medium EALEJNLM Electronic Journal
Spooling in LAN
Environment

V1R0 IBM 4690 Electronic Journal A-5


Created on 6/6/97
Medium EALEJPLM Electronic Journal
4610 Printer Support
Spooling in LAN
Environment
Big EALEJNNB Electronic Journal
Big EALEJPNB Electronic Journal
4610 Printer Support
Big EALEJNLB Electronic Journal
Spooling in LAN
Environment
Big EALEJPLB Electronic Journal
4610 Printer Support
Spooling in LAN
Environment

V1R0 IBM 4690 Electronic Journal A-6


Created on 6/6/97
Programming Information for GSA

The IBM 4690 Electronic Journal will intercept all writes to the journal that pass
through PRINT.EXIT$. If in any of your user exit code you write directly to the
journal, the Electronic Journal will not be able to intercept the print lines. The
text is written onto the paper journal, and is not logged to the electronic journal.
In order to avoid this, when your application writes to the journal, instead of
issuing a “WRITE FORM”, it should use the following function call:

!******************************************************************************
! Definition of Journaling Routine
!******************************************************************************
FUNCTION Journal(Print.line$) EXTERNAL
STRING Journal, Print.line$
FEND
!******************************************************************************
! 1. Precede Print line with a two-byte ASCII field that contains the
! number of lines to advance after printing
! 2. Call Journal
! 3. Check return status:
! If the line was logged to the electronic journal, and it should
! not be printed, a null string will be returned,
! Otherwise, print the line to the journal directly.
!******************************************************************************
Print.line$ = RIGHT$(“0”+STR$(ADVANCE%),2) + Print.line$
Print.line$ = Journal(Print.line$)
IF LEN(Print.line$) <> 0 THEN BEGIN
Print.line$ = RIGHT$(Print.line$,LEN(Print.line$)-2)
FORMAT$ = “C” + STR$(LEN(Print.line$))+”,A” + \
STR$(“0”+STR$(ADVANCE%,2))
WRITE FORM FORMAT$ ; #23 ; Print.line$
ENDIF

V1R0 IBM 4690 Electronic Journal A-7


Created on 6/6/97
Supermarket Application:

Insert Hooks for Electronic Journal Feature

On one of the Integration diskettes you will find a directory named “EAM”, which
contains the following User Exit modules:

EAMTSUSU.J86
EAMTSU01.J86
EAMTSU02.J86
EAMTSU04.J86
EAMTSU05.J86
EAMTSU07.J86
EAMTSU14.J86
EAMTSU18.J86
EAMTSU21.J86
EAMTSU54.J86

You may copy these files into your development directory. You must either use
these J86 files to compile EAMTSUPC, or you must integrate the contents of
these J86 files into your versions of these user exits.

Note that in calling User Exit 7, you need to pass a session number. This
session number is used to open the IBM 4690 Electronic Journal options files at
execution time. Important: Select a session number that is not used anywhere
else in the terminal sales application.

V1R0 IBM 4690 Electronic Journal A-8


Created on 6/6/97
If you do not use the source files provided with the IBM 4690 Electronic Journal,
do the following:

1. In module EAMTSUSU.J86, insert the code:

FUNCTION QXL.TSUPEC01 EXTERNAL


FEND

FUNCTION QXL.TSUPEC02 EXTERNAL


FEND

FUNCTION QXL.TSUPEC04 EXTERNAL


FEND

FUNCTION QXL.TSUPEC05 EXTERNAL


FEND

!*********************************************************************
!
! The session number specified here will be used by
! IBM 4690 Electronic Journal
! Make sure that it is not in conflict with any other session numbers
! It will be used to access disk files on the controller
!
!*********************************************************************
FUNCTION QXL.SESS.NO PUBLIC
INTEGER*2 QXL.SESS.NO
QXL.SESS.NO = 99 ! Session Number to use for personalization
FEND

FUNCTION QXL.TSUPEC07 EXTERNAL


FEND

FUNCTION QXL.TSUPEC14 EXTERNAL


FEND

FUNCTION QXL.TSUPEC18 EXTERNAL


FEND

FUNCTION Journal(PrtLine) EXTERNAL


STRING Journal, PrtLine
FEND

V1R0 IBM 4690 Electronic Journal A-9


Created on 6/6/97
2. In module EAMTSU01.J86, insert the code:

CALL QXL.TSUPEC01

3. In module EAMTSU02.J86, insert the code:

CALL QXL.TSUPEC02

4. In module EAMTSU04.J86, insert the code:

CALL QXL.TSUPEC04

5. In module EAMTSU05.J86, insert the code:

CALL QXL.TSUPEC05

6. In module EAMTSU07.J86, insert the code:

CALL QXL.TSUPEC07

7. In module EAMTSU14.J86, insert the code:

CALL QXL.TSUPEC14

8. In module EAMTSU18.J86, insert the code:

CALL QXL.TSUPEC18

V1R0 IBM 4690 Electronic Journal A-10


Created on 6/6/97
9. In module EAMTSU21.J86, insert the code:

STRING PrtLine

PrtLine = ts.prtbuf$ ! Pass the current line


PrtLine = Journal(PrtLine) ! to Electronic Journal. If Electronic Journal
if PrtLine = "" then begin ! returns a null, then
ts.sjdata$ = string$(len(ts.sjdata$)," ") ! don't print this line
ts.prtbuf$ = string$(len(ts.prtbuf$)," ") ! on the paper journal
endif !

The ‘Journal’ function puts the information in the electronic journal, and
determines whether the data needs to be printed on the physical journal. If
the Journal function returns a null, then the data does not need to be printed;
otherwise, it does.

10. In module EAMTSU54.J86, insert the code:

CALL QXL.TSUPEC54

V1R0 IBM 4690 Electronic Journal A-11


Created on 6/6/97
Link Terminal Sales Application

Once you have re-compiled EAMTSUPC, re-link your terminal module with
QXLEXITS and with the Electronic Journal L86 file that contains the features
that you plan to use. The L86 files are in the EAM directory on one of the
Integration diskettes. If you perform the Tailoring function it will tell you, based
on your feature selections, which L86 file to use.

Copy the QXL*.* files from the root subdirectory of the first Integration Diskette
into the ADX_UPGM directory. From the EAM subdirectory copy the correct L86
files from the chart below (previously identified by executing the steps identified
in Chapter 3).

Add to your INP file an entry for QXLEXITS and an entry for the L86 file you
have chosen. Issue the LINK86 command to link your terminal application.
Follow this with a POSTLINK command.

After linking and postlinking, copy the terminal load file to ADX_IPGM and
distribute the file (compound on close) if using a Local Area Network (LAN). This
must be done for all applications.

Using the Personalization function of the Supermarket application activate


terminal user exits 1, 2, 4, 5, 7, 14, 18, 21, and 54.

NOTE: Separate libraries are provided as a mechanism to reduce the amount of


memory used by the Electronic Journal feature. For example, if you have 1-MB
terminals in a single controller environment with Model 2 printers, you will
significantly reduce the size of the electronic journal code by linking with
EAMEJNNM.L86. In that same environment you could also link with
EAMEJPLM.L86. The function would be identical, but more code space would
be used.

The L86 files are:

Memory Model File Name Features


Medium EAMEJNNM Electronic Journal
Medium EAMEJPNM Electronic Journal
4610 Printer Support

V1R0 IBM 4690 Electronic Journal A-12


Created on 6/6/97
Medium EAMEJNLM Electronic Journal
Spooling in LAN
Environment
Medium EAMEJPLM Electronic Journal
4610 Printer Support
Spooling in LAN
Environment
Big EAMEJNNB Electronic Journal
Big EAMEJPNB Electronic Journal
4610 Printer Support
Big EAMEJNLB Electronic Journal
Spooling in LAN
Environment
Big EAMEJPLB Electronic Journal
4610 Printer Support
Spooling in LAN
Environment

Compile EAMTSUPC.
If using EAMTS10L.INP copy EAMTSUPC.OBJ to EAMTSUPC.LBJ prior to
re-linking the terminal sales application.

V1R0 IBM 4690 Electronic Journal A-13


Created on 6/6/97
Programming Information for Supermarket Application

The IBM 4690 Electronic Journal intercepts all writes to the journal that pass
through User Exit 21. If in any of your user exit code you write directly to the
journal, the Electronic Journal will not be able to intercept the print lines. The
text is written onto the paper journal, and is not logged to the electronic journal.
In order to avoid this, when your application writes to the journal, instead of
issuing a “WRITE FORM”, it should use the following function call:
!******************************************************************************
! Definition of Journaling Routine
!******************************************************************************
FUNCTION Journal(Print.line$) EXTERNAL
STRING Journal, Print.line$
FEND
!******************************************************************************
!! 1. Call Journal, passing line to be printed
! 2. Check return status:
! If the line was logged to the electronic journal, and it should
! not be printed, a null string will be returned,
! Otherwise, print the line to the journal directly.
!******************************************************************************
Print.line$ = Journal(Print.line$)
IF LEN(Print.line$) <> 0 THEN BEGIN
WRITE FORM “C38A1” ; #36 ; Print.line$
ENDIF

V1R0 IBM 4690 Electronic Journal A-14


Created on 6/6/97
Chain Drug Sales Application

You must ensure that the terminal application source code is modified so that
the EJ routines are called. Directions for these changes are found in
“Programming Information for Chain Sales” in this appendix. Note that this step
is not necessary if level 9701 of the CSA application has been installed. As
necessary, issue the compile.

Copy the QXL*.* files from the root subdirectory of the first Integration Diskette
into the ADX_UPGM directory. From the EGH subdirectory on the second
Integration Diskette copy the correct L86 files from the chart below (previously
identified by executing the steps identified in Chapter 3).

Add to your INP file an entry for QXLEXITS, or replace the EGHTNOEJ entry
with QXLEXITS (QXLEXITS.LBJ for big memory model), and add an entry for the
L86 file you have chosen. Issue the LINK86 command to link your terminal
application. Follow this with a POSTLINK command.

After linking and postlinking, copy the terminal load file to ADX_IPGM and
distribute the file (compound on close) if using a Local Area Network (LAN). This
must be done for all applications.

NOTE: Separate libraries are provided as a mechanism to reduce the amount of


memory used by the Electronic Journal feature. For example, if you have 1-MB
terminals in a single controller environment with Model 2 printers, you will
significantly reduce the size of the electronic journal code by linking with
EGHEJNNM.L86. In that same environment you could also link with
EGHEJPLM.L86. The function would be identical, but more code space would
be used

V1R0 IBM 4690 Electronic Journal A-15


Created on 6/6/97
The L86 files are:

Memory Model File Name Features


Medium EGHEJNNM Electronic Journal
Medium EGHEJPNM Electronic Journal
4610 Printer Support
Medium EGHEJNLM Electronic Journal
Spooling in LAN
Environment
Medium EGHEJPLM Electronic Journal
4610 Printer Support
Spooling in LAN
Environment
Big EGHEJNNB Electronic Journal
Big EGHEJPNB Electronic Journal
4610 Printer Support
Big EGHEJNLB Electronic Journal
Spooling in LAN
Environment
Big EGHEJPLB Electronic Journal
4610 Printer Support
Spooling in LAN
Environment

V1R0 IBM 4690 Electronic Journal A-16


Created on 6/6/97
Programming Information for Chain Sales

Some changes need to be made to the following terminal source code modules:

EGHTCKOT
EGHTLWAY
EGHTMAIN
EGHTRCAL
EGHTSUBB

In addition, all direct writes to the summary journal need to be replaced by a call
to the Journal routine. The Journal FUNCTION will return a string; the string will
either be NULL or it will be identical to the input string. If the Journal returns a
null, don't print this line on the summary journal; otherwise, go ahead and print it.
The reason for this is that journal personalization allows you to continue to
create a paper journal in addition to the electronic journal.

In all modules that have direct writes to the SJ: session include the following
external reference:

!*****************************************************************
! FUNCTION: Journal
!*****************************************************************
! Prtline is 40 bytes long.
! The first two bytes contain the number of lines to be skipped
! after printing.
! The remaining 38 bytes are the text to be printed
!
! If Journal returns a Null string, then don't print to the
! paper journal, otherwise do.
!*****************************************************************

FUNCTION Journal(PrtLine) EXTERNAL


STRING Journal
STRING PrtLine
FEND

V1R0 IBM 4690 Electronic Journal A-17


Created on 6/6/97
Replace all direct writes to the SJ: with a call to the Journal function. This is an
example of the replacement:

old.code:
gl.temp1$ = “Line of text”
write form "C38A01"; #sess.printsj; gl.temp1$

new.code:

gl.temp1$ = “Line of text”


IF Journal("01" + \ ! ELECTRONIC JOURNAL
GL.temp1$) <> "" THEN \ ! ELECTRONIC JOURNAL
write form "C38A01"; #sess.printsj; gl.temp1$

V1R0 IBM 4690 Electronic Journal A-18


Created on 6/6/97
Changes to EGHTCKOT

In EGHTCKOT add the following external reference definitions:

!****************************************************************
! ELECTRONIC JOURNAL START
!****************************************************************
! FUNCTION: JOURNAL.TOTAL
!****************************************************************
! called when the transaction total has been computed
!****************************************************************
FUNCTION JOURNAL.TOTAL(TOTAL.AMT$) EXTERNAL
STRING TOTAL.AMT$
FEND

!*****************************************************************
! ELECTRONIC JOURNAL STOP
!*****************************************************************

In the subroutine TOTAL insert the bold text: (marked with ==>)
SUB TOTAL
INTEGER*2 I
INTEGER*1 W.FCFLAG ! flag for foreign currency !IR85937
INTEGER*4 W.TENDPREV ! save for foreign curr prt !IR85937
INTEGER*4 W.TENDAMT ! foreign amount tendered !IR85937
INTEGER*4 W.SAVEFAMT ! save foreign amount due !IR85937
INTEGER*4 W.SAVEAAMT ! save american amount due !IR85937

!AIR89346 START POST DISCOUNT


INTEGER*1 PD.DISCPROG
INTEGER*1 PD.DISCTYPE
INTEGER*1 PD.TRANTYPE
INTEGER*2 PD.DISCPCT
INTEGER*2 PD.RC

PD.DISCPROG = GL.OFF
PD.TRANTYPE = GL.TRANTYPE
!EIR89346 END POST DISCOUNT

!! GL.DISPLINE$ = TD.TDSC$(103) !IR73494


!! CALL DISPLAY (1,1,20) !IR73494

!! GL.DISPLINE$ = " " + ?FORMAT.AMOUNT$(GL.BALDUE) !IR73494


!! CALL DISPLAY (2,5,16) !IR73494

V1R0 IBM 4690 Electronic Journal A-19


Created on 6/6/97
!AIR86890 START SUSPEND/RECALL
IF GL.RECALL = GL.ON THEN \
GOTO RECALL.CONT
!EIR86890 END

GL.CHANGE = 0 ! clear change field


GL.FSCHANGE = 0 ! clear food stamp chg field
GL.TRANFSCHG = 0 ! clear trans f/s chg total
GL.DRWRFLAG = GL.OFF ! reset open drawer flag

CALL TAXCALC (PARMSUBT) ! for subtotal display

GL.BALAMT = GL.BALDUE !IR75331


GL.TEMP1I4 = GL.BALDUE+GL.TAX(1)+ \ calculate tender due
GL.TAX(2)+GL.TAX(3)+GL.TAX(4)+GL.TAXMAN !
GL.NEGBALDUE = GL.OFF ! reset neg baldue flag
IF GL.TEMP1I4 < 0 THEN \ if baldue negative
GL.NEGBALDUE = GL.ON ! set neg baldue flag on
GL.TENDDUE = ABS(GL.TEMP1I4) ! strip sign from tender due

GL.TENDSTPTOT = ABS(GL.STAMPTOT) ! tender f/stampable total


IF (TO.TFLAG4 AND 01H) = 0 THEN \ if f/s don't reduce tax
BEGIN !
FOR I = 0 TO 3 ! for 4 tax plans (0-3)
GL.TENDSTPTOT = GL.TENDSTPTOT+ \ add f/s taxes to stamp-
AUTO.TAX(I,GL.STAMPTAX(I+1)) ! able total
NEXT I !
ENDIF !
GL.TENDSTPTOT = ABS(GL.TENDSTPTOT) ! get abs val for tendering
IF (((GL.BALDUE < 0) AND \ if signs on baldue and
(GL.STAMPTOT > -1)) OR \ food stampable baldue
((GL.BALDUE > -1) AND \ don't match
(GL.STAMPTOT < 0))) THEN \ then
GL.TENDSTPTOT = 0 ! food stamps aren't valid

GL.MOREITEM = GL.OFF ! reset return to itement flag


GL.TENDPROG = GL.OFF ! reset tender in prog flag

IF GL.TENDDUE <> 0 THEN \ if tender due not zero


BEGIN
WHILE ((GL.TENDDUE <> 0) AND (GL.VOIDTOT = GL.OFF))

IF GL.TENDSTPTOT > GL.TENDDUE THEN \ if f/stampable tot > tenddue


GL.TENDSTPTOT = GL.TENDDUE ! set f/stampable tot = tenddue

GL.PRICERTN = GL.ON ! set flag to disp tot

V1R0 IBM 4690 Electronic Journal A-20


Created on 6/6/97
\!AIR85937
REM*********************************************
REM display foreign currency amount due
REM
REM*********************************************
IF (IP.LAST = 29) AND \ if "/" key used AND
(W.FCFLAG) THEN \ foreign currency key
BEGIN !
IF GL.NEGBALDUE = GL.ON THEN \ if a refund
begin !
GL.TEMP1I4 = GL.BALDUE+GL.TAX(1)+ \ calculate tender due
GL.TAX(2)+GL.TAX(3)+GL.TAX(4)+GL.TAXMAN !
W.SAVEAAMT = GL.TEMP1I4 ! save as american
GOSUB W.CALCFAMT1 ! calc foreign amt
GL.DISPLINE$ = \ build a/n2 refund line
"FOREIGN CURRENCY REF" + \
" " + \
?FORMAT.AMOUNT$(GL.TEMP1I4) !
CALL DISPLAY2 (1,1,40) ! display it
endif \
ELSE \
begin !
GOSUB W.CALCFAMT ! calc foreign amt
GL.DISPLINE$ = \ build a/n2 balance line
"FOREIGN CURRENCY DUE" + \
" " + \
?FORMAT.AMOUNT$(GL.TEMP1I4) !
CALL DISPLAY2 (1,1,40) ! display it to custome
ENDIF !
GOSUB W.CALCFAMT ! calc foreign amt
IF GL.NEGBALDUE = GL.ON THEN \ if bal due negative
GL.TEMP1I4 = -GL.TEMP1I4
GL.AMTPROMPT$ = "F/C DUE" + \ display for operator
RIGHT$( \
?FORMAT.AMOUNT$(GL.TEMP1I4),9) !
CALL CLRDISP !
GOSUB TND.AMTPROMPT ! restore real bal due
GOTO W.FOREIGN
ENDIF !
REM*********************************************
\!EIR85937

IF IP.LAST = 29 THEN \ if f/s bal request


IF (SO.TENDFLAG(GL.TENDTYP) \ if f/s key hit
AND 0020H) = 0H THEN \
CALL ERRMSG(3) :\ display error msg
GOTO TND.END :\ skip to end
ELSE \
GL.AMTPROMPT$ = TD.TDSC$(188) + \ build f/s balance
RIGHT$(?FORMAT.AMOUNT$( \ line for display
GL.TENDSTPTOT),8) :\
CALL CLRDISP :\ display f/s balance
GOSUB TND.AMTPROMPT :\ amt disp if cleared
ELSE \
GOSUB TND.AMTPROMPT :\ amt disp
CALL CLRDISP ! display it

!AIR86890 START SUSPEND/RECALL


RECALL.CONT:
!EIR86890 END

V1R0 IBM 4690 Electronic Journal A-21


Created on 6/6/97
!AIR73494
IF GL.NEGBALDUE = GL.ON THEN \ if a refund
begin !
GL.TEMP1I4 = GL.BALDUE+GL.TAX(1)+ \ calculate tender due
GL.TAX(2)+GL.TAX(3)+GL.TAX(4)+GL.TAXMAN !
GL.SHOPLINE$ = \ build shopper refund line
?FORMAT.AMOUNT$(GL.TEMP1I4) !
CALL SHOPDISP(SHOP.REFUND) ! disp w/ refund light
GL.DISPLINE$ = TD.TDSC$(105) + \ build a/n2 refund line
" " + \
?FORMAT.AMOUNT$(GL.TEMP1I4) !
CALL DISPLAY2 (1,1,40) ! display it
endif \
ELSE \
begin !
GL.SHOPLINE$ = \ build shopper balance line
?FORMAT.AMOUNT$(GL.TENDDUE) !
CALL SHOPDISP(SHOP.BALDUE) ! disp w/ baldue light
GL.DISPLINE$ = TD.TDSC$(194) + \ build a/n2 balance line
" " + \
?FORMAT.AMOUNT$(GL.TENDDUE) !
CALL DISPLAY2 (1,1,40) ! display it
ENDIF !
!EIR73494

W.FOREIGN: ! !IR85937
W.FCFLAG = GL.OFF ! clear foreign currency flag !IR85937

!AIR89346 START POST DISCOUNT


PD.RETURN:
IF GL.NEGBALDUE = GL.OFF THEN \
BEGIN
GL.DISPLINE$ = LEFT$(TD.TDSC$(103),6) + \ build a/n2 balance
line
?FORMAT.AMOUNT$(GL.TENDDUE) !
CALL DISPLAY2 (2,5,16) ! display it
GL.DISPLINE$ = GL.NULL$ ! clear top line of
CALL DISPLAY2 (1,1,20) ! display 2

IF (PD.DISCOUNT <> 0) THEN \ if there is a discount


BEGIN
GL.DISPLINE$ = "DISCOUNT " + \ build a/n2 discount line
?FORMAT.AMOUNT$(PD.DISCOUNT)!
IF GL.NEGBALDUE <> GL.ON THEN \ if bal due not negative
GL.DISPLINE$ = LEFT$(GL.DISPLINE$,19) + "-" !
CALL DISPLAY2 (1,1,20) ! display it as negative
ENDIF !
ENDIF !
!EIR89346 END POST DISCOUNT

CALL INPTWAIT (16) ! unlock tender state

GL.PRICERTN = GL.OFF ! set flag off

V1R0 IBM 4690 Electronic Journal A-22


Created on 6/6/97
!AIR89346 START POST DISCOUNT
IF PD.DISCON <> 0 OR \check if discount on
PD.DISCPROG = GL.ON THEN \
BEGIN
IF IP.FCODE2 = 61 OR \ check for any of the 3
IP.FCODE2 = 62 OR \ discount keys entered
IP.FCODE2 = 64 THEN \
BEGIN !
CALL ERRMSG (64) :\ function not allowed message
GOTO TND.END !
ENDIF
ENDIF

IF IP.FCODE2 = 61 OR \ check for any of the 3


IP.FCODE2 = 62 OR \ discount keys entered
IP.FCODE2 = 64 THEN \
BEGIN !
IF IP.FCODE9 = KB.CLEAR THEN \
GOTO PD.RETURN

PD.DISCPROG = GL.ON ! don't allow another discount


! to be taken
IF IP.FCODE2 = 62 THEN \ if it's empl. disc get the
BEGIN
IF (SP.SALEFLAG AND 0100H) = 0000H THEN \ !check for auth
BEGIN
CALL ERRMSG(76)
CALL SECURITY(24,0)
IF GL.AUTHORIZED = GL.OFF THEN \
BEGIN
PD.DISCPROG = GL.OFF
GOTO TND.END
ENDIF
ENDIF

PD.DISCPCT = TO.EMPLRATE ! disc pct from term options


PD.DISCTYPE = 1 ! identify type of discount
GL.TRANTYPE = 11 ! indicate empl sale
PD.DISCON = GL.TRANTYPE ! indicate discount selected
ENDIF

IF IP.FCODE2 = 61 THEN \ if it's club1 get the %


BEGIN !
PD.DISCPCT = TO.CLB1RATE ! disc pct from term options
PD.DISCTYPE = 2 ! club 1
GL.TRANTYPE = 12 ! indicate clb1 sale
PD.DISCON = GL.TRANTYPE ! indicate discount selected
ENDIF !
!
IF IP.FCODE2 = 64 THEN \
BEGIN !
PD.DISCPCT = TO.CLB2RATE ! otherwise it's club2. Get %
PD.DISCTYPE = 3 ! club 2
GL.TRANTYPE = 13 ! indicate clb2 sale
PD.DISCON = GL.TRANTYPE ! indicate discount selected
ENDIF

CALL PD.CALC.DISC(PD.DISCTYPE,PD.DISCPCT,PD.RC) !give discount

GL.BALAMT = GL.BALDUE !IR75331


GL.TEMP1I4 = GL.BALDUE+GL.TAX(1)+ \ calculate tender due
GL.TAX(2)+GL.TAX(3)+GL.TAX(4)+GL.TAXMAN !
GL.NEGBALDUE = GL.OFF ! reset neg baldue flag
IF GL.TEMP1I4 < 0 THEN \ if baldue negative
GL.NEGBALDUE = GL.ON ! set neg baldue flag on
GL.TENDDUE = ABS(GL.TEMP1I4) ! get a positive tender

GOTO TND.END !
ENDIF !

V1R0 IBM 4690 Electronic Journal A-23


Created on 6/6/97
!EIR89346 END POST DISCOUNT

IF IP.FCODE3 = KB.TOTAL THEN \ if total key


IF IP.FCODE4 = KB.VOID THEN \ if void-total
CALL SECURITY (3,0) :\ check security for vtrans
IF GL.AUTHORIZED = GL.ON THEN\ if passed
GL.VOIDTOT = GL.ON :\ set up void total
GOTO TND.END :\ skip to end
ELSE \ else
GOTO TND.END :\ skip to end
ELSE \ else (total alone)
CALL ERRMSG (3) :\ display key seq error
GOTO TND.END ! skip to end

!AIR89346 START POST DISCOUNT


IF IP.FCODE2 = KB.SUBTOT THEN \ if subtotal entered
IF GL.TENDPROG = GL.OFF THEN \ no tenders accepted yet
GL.TRANTYPE = PD.TRANTYPE
IF (PD.DISCON <> 0) THEN \ if there is a discount
GL.TRANTYPE = PD.DISCON :\ set disc. type on
IP.WRK.LAST = 13 ! discount state
!EIR89346 END POST DISCOUNT

IF IP.FCODE2 = KB.SUBTOT THEN \ if subtotal entered


IF GL.TENDPROG = GL.OFF THEN \ no tenders accepted yet
IF GL.LAYAWAY = GL.OFF THEN \ IF NOT LAYAWAY IR80907
GL.MOREITEM = GL.ON :\ set return to itement
GOTO TOT.END :\ skip to exit
ELSE \
CALL ERRMSG (3) :\ key sequence err msg
GOTO TND.END ! skip to end

!AIR86890 START SUSPEND/RECALL


IF IP.FCODE2 = GL.SRKEY THEN \ if suspend entered
BEGIN
IF ((SP.SALEFLAG AND 0010H) = 0) THEN \ If bit off
BEGIN
CALL ERRMSG(76) ! display not auth msg
CALL SECURITY(24,0) ! call security for override
IF GL.AUTHORIZED = GL.OFF THEN \ if not overridden
GOTO TND.END ! try again
ENDIF
CALL SUSPEND !
IF GL.SUSPEND = GL.ON THEN \
GOTO TOT.END \
ELSE \
GOTO TND.END !
ENDIF
!EIR86890 END

V1R0 IBM 4690 Electronic Journal A-24


Created on 6/6/97
ON (IP.FCODE1 - 78) GOTO \ dollar and tender key setup
TND.20, \ $20.00
TND.10, \ $10.00
TND.5, \ $ 5.00
TND.1, \ $ 1.00
TND.TYP3, \ tender type 3
TND.TYP4, \ tender type 4
TND.TYP5, \ tender type 5
TND.TYP6, \ tender type 6
TND.TYP1, \ tender type 1
TND.TYP2, \ tender type 2
TND.TYP7, \ tender type 7
TND.TYP8 ! tender type 8

CALL ERRMSG(3) ! key sequence error


GOTO TND.END ! try again

TND.20:
IP.DATA1$ = "2000" ! force 20.00 into kybd buffer
GL.TENDTYP = 1 ! set subscript for cash tender
GOTO TND.OK

TND.10:
IP.DATA1$ = "1000" ! force 10.00 into kybd buffer
GL.TENDTYP = 1 ! set subscript for cash tender
GOTO TND.OK

TND.5:
IP.DATA1$ = "500" ! force 5.00 into kybd buffer
GL.TENDTYP = 1 ! set subscript for cash tender
GOTO TND.OK

TND.1:
IP.DATA1$ = "100" ! force 1.00 into kybd buffer
GL.TENDTYP = 1 ! set subscript for cash tender
GOTO TND.OK

TND.TYP1:
GL.TENDTYP = 1 ! set subscript for tend type 1
GOTO TND.OK

TND.TYP2:
GL.TENDTYP = 2 ! set subscript for tend type 2
GOTO TND.OK

TND.TYP3:
GL.TENDTYP = 3 ! set subscript for tend type 3
GOTO TND.OK

TND.TYP4:
GL.TENDTYP = 4 ! set subscript for tend type 4
GOTO TND.OK

TND.TYP5:
GL.TENDTYP = 5 ! set subscript for tend type 5
GOTO TND.OK

TND.TYP6:
GL.TENDTYP = 6 ! set subscript for tend type 6
GOTO TND.OK

TND.TYP7:
GL.TENDTYP = 7 ! set subscript for tend type 7
GOTO TND.OK

V1R0 IBM 4690 Electronic Journal A-25


Created on 6/6/97
TND.TYP8:
\!AIR85937
IF SO.EXCHRATE <> 0 THEN \ if selected
W.FCFLAG = GL.ON :\ set switch
GOSUB W.CALCFAMT ! calc foreign amt
\!EIR85937
GL.TENDTYP = 8 ! set subscript for tend type 8

TND.OK:

!AIR89346 START POST DISCOUNT


PD.DISCPROG = GL.ON ! no discounting after tender
!EIR89346 END POST DISCOUNT

IF IP.LAST = 29 THEN \ if here from f/s bal request


GOTO TND.END ! handle it above on next pass

IF NOT(SO.TENDFLAG(GL.TENDTYP) AND 4000H) THEN \ if not allowed


CALL ERRMSG (31) :\ tender not allowed message
GOTO TND.END !

GL.TENDAMT = VAL(IP.DATA1$) ! take tend amt from kybd

\!AIR85937
REM*****************************************
REM if foreign currency flip back to American equivalent
REM*****************************************
IF W.FCFLAG THEN BEGIN
IF GL.TENDAMT = 0 THEN \ if tender amt = 0
IF SO.TENDFLAG(GL.TENDTYP) AND 0040H THEN\ auto bal due allow
GL.TENDAMT = W.SAVEFAMT \ tender amt = tender bal due
ELSE \ else
CALL ERRMSG (52) :\ display zero amount error
GOTO TND.END ! skip to end

W.TENDAMT = GL.TENDAMT ! save amount entered


IF W.SAVEFAMT = W.TENDAMT THEN \
GL.TENDAMT = W.SAVEAAMT \
ELSE \
GL.TENDAMT = ?AMERICAN( W.TENDAMT)
W.SAVEAAMT = GL.TENDAMT
ENDIF
\!EIR85937

IF GL.NEGBALDUE = GL.ON THEN \ if baldue is negative


IF GL.TENDAMT > GL.TENDDUE THEN \ if tender > tender due
CALL ERRMSG (29) :\ can't return tender msg
GOTO TND.END ! skip to end !AIR83961
!DELETED GOTO TND.END :\ skip to end
!DELETED ELSE \ else
!AIR89633
IF ((SO.TENDFLAG(GL.TENDTYP) AND 0020H) = 0) THEN \not food stamps
IF ((SO.TENDFLAG(GL.TENDTYP) AND 2000H)=0) THEN \ can't refund
CALL ERRMSG (21) :\ can't refund error msg
GOTO TND.END ! skip to end
!EIR89633

IF GL.TENDAMT = 0 THEN \ if tender amt = 0


IF SO.TENDFLAG(GL.TENDTYP) AND 0040H THEN\ auto bal due allowed
GL.TENDAMT = GL.TENDDUE \ tender amt = tender bal due
ELSE \ else
CALL ERRMSG (52) :\ display zero amount error
GOTO TND.END ! skip to end

IF (TL.NEXT > (TL.MAXSIZE-7)) AND \ only log space for 1 tender


(GL.TENDAMT < GL.TENDDUE) THEN \ and not full tender
CALL ERRMSG (32) :\ must tender balance error
GOTO TND.END ! skip to end

V1R0 IBM 4690 Electronic Journal A-26


Created on 6/6/97
IF SO.TENDFLAG(GL.TENDTYP) AND 0020H THEN \ if food stamps
IF GL.TENDSTPTOT = 0 THEN \ if no f/s bal due
CALL ERRMSG (28) :\ no f/s err msg
GOTO TND.END \ skip to end
ELSE \ else
IF (GL.TENDAMT-GL.TENDSTPTOT) > 99 THEN\ if f/s > chng limit
GL.FSCHANGE = \ whole dollar dif is f/s chg
(((GL.TENDAMT-GL.TENDSTPTOT)/100)*100)

W.TENDPREV = GL.TENDDUE ! save balance due for print !IR85937

IF (GL.TENDAMT-GL.FSCHANGE) > GL.TENDDUE THEN \if tender>tend due


IF ((SO.TENDFLAG(GL.TENDTYP) AND 0020H) AND \ if f/stamp
(GL.FSCHANGE > SO.TENDCHNG(GL.TENDTYP)) OR\ f/s chg >
((SO.TENDFLAG(GL.TENDTYP) AND 0020H)=0) AND \ not f/stamp
((GL.TENDAMT-GL.TENDDUE) > SO.TENDCHNG(GL.TENDTYP)))THEN \
BEGIN
CALL SECURITY (GL.TENDTYP+9,30)! for ok to exceed limit
IF GL.AUTHORIZED = GL.OFF THEN \ if ok
GOTO TND.END ! proceed
ENDIF ! IR74464
!AIR74464
CALL ACCTNUM ! in case need acct number
IF GL.AUTHORIZED = GL.OFF THEN \ if acct# prompt cleared
GOTO TND.END ! skip to end
IF GL.VOIDTOT = GL.ON THEN \ if acct# void-totaled
GOTO TND.END ! skip to end

IF (GL.TENDAMT-GL.FSCHANGE) > GL.TENDDUE THEN \if tender>tend due


\!EIR74464
GL.CHANGE = GL.TENDAMT-GL.TENDDUE-GL.FSCHANGE :\ calc change
GL.TENDDUE = 0 :\ clr tenddue
ELSE \ else
GL.TENDDUE=GL.TENDDUE-GL.TENDAMT+GL.FSCHANGE ! adj tenddue

IF SO.TENDFLAG(GL.TENDTYP) AND 0020H THEN \ if food stamps


IF (GL.TENDAMT > GL.TENDSTPTOT) \ if tend > f/s bdue !AIR83961
AND (GL.NEGBALDUE = GL.OFF) THEN \ if NOT neg bal !EIR83961
BEGIN !
GL.TEMP1I4 = GL.TENDSTPTOT ! save f/s baldue
ENDIF \
ELSE \
BEGIN !
GL.TEMP1I4 = GL.TENDAMT ! save f/s amount
ENDIF :\
GL.TENDSTPTOT = GL.TENDSTPTOT-GL.TENDAMT :\ reduce f/s due
IF GL.TENDSTPTOT < 0 THEN \ if now negative
BEGIN !
GL.TENDSTPTOT = 0 ! set to zero
ENDIF :\
IF TO.TFLAG4 AND 01H THEN \ if f/s affect tax
FOR I = 1 TO 4 ! for 4 tax plans
if GL.NEGBALDUE = GL.ON THEN \ if neg bal !AIR83961
gl.temp1i4=-gl.temp1i4 ! flip the sign
! f/s txbl >= tnd
IF abs(GL.STAMPTAX(I)) >= abs(GL.TEMP1I4) THEN \ !EIR83961
GL.TAXTOT(I)=GL.TAXTOT(I)-GL.TEMP1I4 :\ reduce txbl tot
GL.STAMPTAX(I)=GL.STAMPTAX(I)-GL.TEMP1I4 :\ red f/s txbl
ELSE \
GL.TAXTOT(I)=GL.TAXTOT(I)-GL.STAMPTAX(I) :\ red txbl tot
GL.STAMPTAX(I) = 0 ! clear f/s txbl tot
NEXT I !

V1R0 IBM 4690 Electronic Journal A-27


Created on 6/6/97
IF GL.NEGBALDUE = GL.ON THEN \ if bal due is negative
GL.TENDAMT = -GL.TENDAMT ! reverse sign on tend amt

IF SO.TENDFLAG(GL.TENDTYP) AND 0010H THEN \ if tndr req open drwr


GL.DRWRFLAG = GL.ON ! set drawer flag on

IF ((GL.TENDPROG = GL.OFF) OR \ if first tender OR


(((SO.TENDFLAG(GL.TENDTYP) AND 0020H)=20H) \ if food stamps and
AND ((TO.TFLAG4 AND 01H)=01H))) AND \ f/s affect taxability
(GL.LAYAWAY = GL.OFF) THEN \
CALL TAXCALC (PARMTOTL) :\ for tax lines and logging
GL.TEMP1I4 = GL.BALAMT + \ get balance due !IR75331
GL.TAX(1)+GL.TAX(2)+GL.TAX(3)+ \
GL.TAX(4)+GL.TAXMAN :\
\************************************
==> \ ELECTRONIC JOURNAL START
==> \************************************
==> CALL JOURNAL.TOTAL(?FORMAT.AMOUNT$(GL.TEMP1I4)):
==> \************************************
==> \ ELECTRONIC JOURNAL STOP
==> \************************************
GL.PRTLINE$ = " " + \ build total print line
TD.TDSC$(103) + " " + \
?FORMAT.AMOUNT$(GL.TEMP1I4) :\
CALL PRINTER (PRD0J1C2) :\ print it
GL.TENDPROG = GL.ON :\ indicate tender started
GL.TEMP1I4 = \ accumulate !AIR83961
GL.TAXDELTA(1)+GL.TAXDELTA(2)+ \ any tax changes caused
GL.TAXDELTA(3)+GL.TAXDELTA(4) :\ by food stamp tender
IF ((SO.TENDFLAG(GL.TENDTYP) AND 0020H)=20H) \ if food
AND ((TO.TFLAG4 AND 01H)=01H) \ stamps and
AND (GL.NEGBALDUE = GL.ON) THEN \ neg bal due
BEGIN ! f/s affect taxability
GL.TEMP1I4=-GL.TEMP1I4 ! flip taxdelta(s)
ENDIF :\
GL.TENDDUE=GL.TENDDUE+GL.TEMP1I4 ! adjust tender due !EIR83961

!AIR75331
!AIR83961 IF GL.NEGBALDUE = GL.ON THEN !
! GL.BALAMT = GL.BALAMT + GL.TENDAMT !
!EIR83961 ELSE !
GL.BALAMT = GL.BALAMT - GL.TENDAMT !
!EIR75331
! if over-tendered by
\!AIR85937
REM*****************************************
REM if foreign currency print foreign amount due
REM followed by exchange rate
REM*****************************************
IF W.FCFLAG THEN \
BEGIN !
GL.TEMP1I4 = ?FOREIGN(W.TENDPREV)!
IF GL.NEGBALDUE = GL.ON THEN \ if bal due negative
GL.TEMP1I4 = -GL.TEMP1I4
GL.PRTLINE$ = " " + \ build total print line
"FOREIGN CURR TOTAL" + \
?FORMAT.AMOUNT$(GL.TEMP1I4) !
CALL PRINTER (PRD0J1C1) ! print it

REM get exchange rate


GL.TEMP1$ = RIGHT$("0000000000" + \
STR$(SO.EXCHRATE),10) !
GL.TEMP1$ = LEFT$(GL.TEMP1$,3) + \
"." + RIGHT$(GL.TEMP1$,7) !

V1R0 IBM 4690 Electronic Journal A-28


Created on 6/6/97
REM try to clean it up a little, strip off leading and trailing 0's
FOR GL.TEMP1I2 = 1 TO 2 !
IF LEFT$(GL.TEMP1$,1) = "0" THEN \
GL.TEMP1$ = RIGHT$(GL.TEMP1$,(11-GL.TEMP1I2)) :\
ELSE \
GL.TEMP1I2 = 3 !
NEXT GL.TEMP1I2 !

GL.TEMP2I2 = LEN(GL.TEMP1$) !
FOR GL.TEMP1I2 = GL.TEMP2I2 TO 5 STEP -1
IF RIGHT$(GL.TEMP1$,1) = "0" THEN \
GL.TEMP1$ = LEFT$(GL.TEMP1$,(GL.TEMP1I2 -1)) :\
ELSE \
GL.TEMP1I2 = 3 !set to get out of loop
NEXT GL.TEMP1I2 !

GL.PRTLINE$ = " " + \


GL.TEMP1$ + \ print current exch rate
" EXCHANGE RATE" !
CALL PRINTER (PRD0J1C2) ! print it
ENDIF !
\!EIR85937

IF GL.TENDDUE < 0 THEN \ food stamp tax adjustment


GL.CHANGE = GL.CHANGE + \ add food stamp tax
ABS(GL.TENDDUE) :\ tax adjustment to change
GL.TENDDUE = 0 ! stop tender processing

\!AIR85937
REM*****************************************
REM if foreign currency flip tender amount to foreign equivalent
REM*****************************************
IF GL.NEGBALDUE = GL.ON THEN \ if bal due is negative
W.TENDAMT = -W.TENDAMT :\ reverse sign on tend amt
W.SAVEAAMT = -W.SAVEAAMT ! reverse sign on tend amt

IF W.FCFLAG THEN \
GL.TENDAMT = W.TENDAMT
\!EIR85937

GL.PRTLINE$ = " " + \ build tender prt line


SO.TENDDESC$(GL.TENDTYP) + \
?FORMAT.AMOUNT$(GL.TENDAMT) !
CALL PRINTER (PRD0J1C1) ! print it

IF SO.TENDFLAG(GL.TENDTYP) AND 0400H THEN \ If acct number req'd


GL.PRTLINE$ = " " + \ build acct num print line
TD.TDSC$(108) + \
GL.ACCTNUM$ + \
GL.BLANKS$ :\
CALL PRINTER (PRD0J1C1) :\ print at cr and jt
IF SO.HCREDFLG(GL.TENDTYP) AND 40H THEN \ if exp date req'd
begin !
GL.PRTLINE$ = " " + \
TD.TDSC$(190) + \ build exp date line
" " + \
LEFT$(GL.EXPDATE$,2) + \
"/" + \
RIGHT$(GL.EXPDATE$,2) !
CALL PRINTER (PRD0J1C1) ! print it
ENDIF !IR76970

V1R0 IBM 4690 Electronic Journal A-29


Created on 6/6/97
!AIR76970 IF GL.HPRTFLG$ <> "00" THEN \ if host print req'd
! GL.PRTLINE$ = GL.HPRINT$ :\ get host print line
! IF LEFT$(GL.HPRTFLG$,1) = "1" THEN \ if journal prt req'd
! begin !
! CALL PRINTER(PRD0J1C0) ! print at journal
! ENDIF :\
! IF RIGHT$(GL.HPRTFLG$,1) = "1" THEN \ if receipt prt req'd
! begin !
! CALL PRINTER(PRD0J0C1) ! print at receipt
!EIR76970 ENDIF !

CALL ENDORSE ! franking, endorse

\!AIR85937
REM*****************************************
REM if foreign currency flip back to American equivalent
REM*****************************************
IF W.FCFLAG THEN \
CALL ADD4TOT(W.TENDAMT,AC.OFF.FOREIGN) :\ add tend amt to foreign
GL.TENDAMT = W.SAVEAAMT
\!EIR85937

IF GL.NEGBALDUE = GL.ON THEN \ if a tender refund then


CALL ADD4TOT(GL.TENDAMT, \ add tend amt to trans ref
AC.OFF.AMTREF(GL.TENDTYP)) :\
CALL ADD4TOT(-GL.FSCHANGE, \ sub f/s chg from trans ref
AC.OFF.AMTREF(GL.TENDTYP)) !

CALL ADD4TOT(GL.TENDAMT, \ add tend amt to trans accum


AC.OFF.AMTTEND(GL.TENDTYP)) !
CALL ADD2TOT(1, \ add tend cnt to trans accum
AC.OFF.NUMTEND(GL.TENDTYP)) !
CALL ADD4TOT(-GL.FSCHANGE, \ sub f/s chg from trans accum
AC.OFF.AMTTEND(GL.TENDTYP)) !
CALL ADD4TOT(-GL.CHANGE, \ sub chg from cash accum
AC.OFF.AMTTEND(1)) !

CALL LOGTENDER ! to build tlog tender string

IF GL.FSCHANGE <> 0 THEN \ if f/s change


CALL LOGFSTAMP :\ to build tlog f/s chg string
GL.TRANFSCHG = GL.FSCHANGE ! save f/s chg for tran end

\!AIR85937
REM*****************************************
REM if foreign currency flip back to Foreign equivalent
REM*****************************************
IF W.FCFLAG THEN \
GL.TENDAMT = W.TENDAMT
\!EIR85937

V1R0 IBM 4690 Electronic Journal A-30


Created on 6/6/97
TND.END:
GL.FSCHANGE = 0 ! clear f/s change filed
WEND
ENDIF \
ELSE \
BEGIN !
CALL TAXCALC (PARMTOTL) ! for tax lines & logging !IR73472
==> !************************************
==> ! ELECTRONIC JOURNAL START
==> !************************************
==> CALL JOURNAL.TOTAL(?FORMAT.AMOUNT$(0))
==> !************************************
==> ! ELECTRONIC JOURNAL STOP
==> !************************************
GL.PRTLINE$ = " " + \ build zero total print line
TD.TDSC$(103) + " " + \
?FORMAT.AMOUNT$(0) !
CALL PRINTER (PRD0J1C2) ! print it
ENDIF !

IF GL.VOIDTOT THEN \ if void totaled


GOTO TOT.END ! skip to end

IF GL.CHANGE <> 0 OR \ if change or


GL.TRANFSCHG <> 0 OR \ f/s change or
GL.DRWRFLAG = GL.ON THEN \ open drwr flag on then
CALL OPENDRWR ! open cash drwr

IF GL.NEGBALDUE = GL.ON THEN \ if balance due negative


GL.TEMP1I4 = GL.BALDUE + \ get baldue
GL.TAX(1) + GL.TAX(2) + \
GL.TAX(3) + GL.TAX(4) + GL.TAXMAN:\
GL.DISPLINE$ = TD.TDSC$(105) :\ build refund descr
CALL DISPLAY (1,1,20) :\ display it on line 1
CALL DISPLAY2(1,1,20) :\ display it on line 1 !IR73494
GL.DISPLINE$ = " " + \ build refund line
?FORMAT.AMOUNT$(GL.TEMP1I4) :\
CALL DISPLAY (2,5,15) :\ display it on line 2
CALL DISPLAY2(2,5,15) :\ display it on line 2 !IR73494
GL.SHOPLINE$ = \ build shopper line !IR73494
?FORMAT.AMOUNT$(GL.TEMP1I4) :\ !IR73494
CALL SHOPDISP(SHOP.REFUND) :\ disp w/ refund light !IR73494
GL.PRTLINE$ = " " + \ build refund line
TD.TDSC$(105) + " "+ \
?FORMAT.AMOUNT$(GL.TEMP1I4) :\
CALL PRINTER (PRD0J1C2) :\ print it
ELSE \ else
IF GL.TRANFSCHG <> 0 THEN \ if food stamp change
BEGIN !
GL.PRTLINE$ = " "+ \ build f/s change line
TD.TDSC$(148) + " "+ \
?FORMAT.AMOUNT$(GL.TRANFSCHG) !
CALL PRINTER (PRD0J1C1) ! print it
GL.DISPLINE$ = TD.TDSC$(148) + \ build f/s chg display line
?FORMAT.AMOUNT$(GL.TRANFSCHG) !
CALL DISPLAY (1,1,20) ! display it line 1
CALL DISPLAY2(1,1,20) ! display it line 1 !IR73494
GL.DISPLINE$ = TD.TDSC$(102) + \ build change display line
?FORMAT.AMOUNT$(GL.CHANGE) !
CALL DISPLAY (2,5,16) ! display it on line 2
CALL DISPLAY2(2,5,16) ! display it on line 2 !IR73494
ENDIF \
ELSE \ else (no f/s chg)
BEGIN
GL.DISPLINE$ = TD.TDSC$(102) ! build change descriptor
CALL DISPLAY (1,1,20) ! display it on line 1
CALL DISPLAY2(1,1,20) ! display it on line 1
!IR73494

V1R0 IBM 4690 Electronic Journal A-31


Created on 6/6/97
GL.DISPLINE$ = " " + \ build change amt line
?FORMAT.AMOUNT$(GL.CHANGE) !
CALL DISPLAY (2,5,16) ! display it on line 2
CALL DISPLAY2(2,5,16) ! display it on line 2 !IR73494
ENDIF :\
GL.SHOPLINE$ = \ build shopper line !IR73494
?FORMAT.AMOUNT$(GL.CHANGE) :\ !IR73494
CALL SHOPDISP(SHOP.CHANGE) :\ disp w/ change light !IR73494
GL.PRTLINE$ = " " + \ build change print line
TD.TDSC$(102) + " " + \
?FORMAT.AMOUNT$(GL.CHANGE) :\
CALL PRINTER (PRD0J1C2) ! print it

TOT.END:
EXIT SUB

TND.AMTPROMPT:
GL.AMTPROMPT$ = LEFT$(TD.TDSC$(103),6) + \ build total display
?FORMAT.AMOUNT$(GL.TENDDUE) !
IF GL.NEGBALDUE = GL.ON THEN \ if bal due negative
GL.AMTPROMPT$ = LEFT$(GL.AMTPROMPT$,15) + "-" !
RETURN

\!AIR85937
W.CALCFAMT:
W.SAVEAAMT = GL.TENDDUE !
W.CALCFAMT1:
GL.TEMP1I4 = ?FOREIGN(W.SAVEAAMT) !
W.SAVEFAMT = GL.TEMP1I4 !
RETURN
\!EIR85937

END SUB

V1R0 IBM 4690 Electronic Journal A-32


Created on 6/6/97
Changes to EGHTLWAY

In EGHTLWAY add the following external reference definition:

!****************************************************************
! ELECTRONIC JOURNAL START
!****************************************************************
! FUNCTION: JOURNAL.TOTAL
!****************************************************************
! called as total is about to be printed
!****************************************************************
FUNCTION JOURNAL.TOTAL(TOTAL.AMT$) EXTERNAL
STRING TOTAL.AMT$
FEND

!****************************************************************
! ELECTRONIC JOURNAL STOP
!****************************************************************

In the LWAY.PAYMENT subroutine add the bold text: (marked with ==>)
SUB LWAY.PAYMENT PUBLIC

INTEGER*2 I

IF GL.VOIDTOT = GL.ON THEN \ if tran has been voided


EXIT SUB ! get out
GL.BALAMT = GL.BALDUE ! AMT FOR SUBTOTAL IR90658

IF GL.TRANTYPE = 14 THEN \ if return trans


IF (LW.FLAGS AND 60H) = 0 THEN \ if not prev cancel
CALL TAXCALC(PARMSUBT) :\ get taxes updated
IF (GL.BALDUE + GL.TAX(1) + \ if balance of items not
GL.TAX(2) + GL.TAX(3) + \
GL.TAX(4) + GL.TAXMAN) \
<> \
-LW.INITIAL THEN \ equal to initial sale
CALL ERRMSG(86) :\ error message
GL.MOREITEM = GL.ON :\ set return to item entry
EXIT SUB :\ exit sub
ELSE \
GL.TENDPROG = GL.OFF :\NO TAX DELTA IR90658
CALL TAXCALC(PARMTOTL) :\ do final taxes
GL.TENDPROG = GL.ON :\RESET IND IR90658
LWAY.RET = -LW.INITIAL ! save ret $ for acct updates

IF LW.INITIAL = 0 THEN \ if initial layaway


GL.TENDPROG = GL.ON :\ prevent return to item ent
CALL TAXCALC(PARMSUBT) ! calculate taxes

V1R0 IBM 4690 Electronic Journal A-33


Created on 6/6/97
LWAY.PAY.PROMPT:

IF GL.TRANTYPE = 14 THEN \ if return trans


IF LW.FLAGS AND 20H THEN \ if prev cancel w/o customer
BEGIN !
GL.BALDUE = -LW.PAYMENTS ! baldue = return of prev pmts
LWAY.PMT = -LW.PAYMENTS ! force payment = prev pmts
LW.FLAGS = LW.FLAGS OR 40H ! set refunded flag on
EXIT SUB ! exit sub
ENDIF :\
GL.AMTPROMPT$ = \ build balance prompt
TD.TDSC$(179) + " " + \
?FORMAT.AMOUNT$(LW.PAYMENTS) :\
GL.PRICERTN = GL.ON :\ tell clrdisp to display it
CALL CLRDISP :\ display 1st time
CALL INPTWAIT(26) :\ prompt for return payment
ELSE \ else
GL.AMTPROMPT$ = \ build balance prompt
TD.TDSC$(179) + " " + \
?FORMAT.AMOUNT$(LW.INITIAL + \
GL.BALDUE + GL.TAX(1) + \
GL.TAX(2) + GL.TAX(3) + \
GL.TAX(4) + GL.TAXMAN + \
LWAY.INIT + LW.FEE - LW.PAYMENTS):\
GL.PRICERTN = GL.ON :\ tell clrdisp to display it
CALL CLRDISP :\ display 1st time
CALL INPTWAIT(25) ! prompt for payment

GL.PRICERTN = GL.OFF ! turn off display flag

!IR80907
IF (IP.FCODE2 = KB.TOTAL) AND \IF TOTAL KEY BUT NOT
(IP.FCODE8 <> KB.VOID) THEN \VOID KEY, DISPLAY
CALL ERRMSG (3) :\ KEYING SEQ ERR MSG
GOTO LWAY.PAY.PROMPT ! AND TRY AGAIN
!IR80907

IF IP.FCODE8 = KB.VOID THEN \ if voided


GL.VOIDTOT = GL.ON :\ set void-total flag on
EXIT SUB ! exit sub

LWAY.PMT = VAL(IP.DATA1$) ! keep payment amount

IF GL.TRANTYPE <> 14 THEN \ if not a return trans


IF ((LW.INITIAL = 0) AND \ if initial AND
(LWAY.PMT > (GL.BALDUE + \ payment exceeds total
GL.TAX(1) + GL.TAX(2) + \
GL.TAX(3) + GL.TAX(4) + \
GL.TAXMAN))) OR \ OR
((LW.INITIAL <> 0) AND \ if not an initial AND
(LWAY.PMT > (LW.INITIAL + \ payment exceeds balance
LWAY.INIT + \
LW.FEE - LW.PAYMENTS))) THEN \
BEGIN !
CALL ERRMSG(84) ! display error
GOTO LWAY.PAY.PROMPT ! try again
ENDIF :\
LW.PAYMENTS = \ update payment
LW.PAYMENTS + LWAY.PMT :\
LW.DATEPAY$ = PACK$(DATE$) :\ update date

V1R0 IBM 4690 Electronic Journal A-34


Created on 6/6/97
ELSE \
IF (LWAY.PMT <> LW.PAYMENTS) AND \ if payment not = total pmts
(LWAY.PMT <> 0) THEN \ and not = 0 (cust not pres)
BEGIN !
CALL ERRMSG(84) ! display error
GOTO LWAY.PAY.PROMPT ! try again
ENDIF :\
IF LWAY.PMT = 0 THEN \ if customer not present
LW.FLAGS = LW.FLAGS OR 20H \ set no refund flag on
ELSE \
LWAY.PMT = -LWAY.PMT :\ reverse sign on payment
LW.FLAGS = LW.FLAGS OR 40H ! set refunded flag on

IF LW.INITIAL = 0 THEN \ if initial layaway


GL.TENDPROG = GL.OFF :\NO TAX DELTA IR79818
CALL TAXCALC(PARMTOTL) :\ force taxes to print
GL.TENDPROG = GL.ON :\RESET IND IR79818
GL.TEMP1I4 = GL.BALDUE + \ calculate total
GL.TAX(1) + GL.TAX(2) + \
GL.TAX(3) + GL.TAX(4) + \
GL.TAXMAN :\
==> \************************************
==> \ ELECTRONIC JOURNAL START
==> \************************************
==> CALL JOURNAL.TOTAL(?FORMAT.AMOUNT$(GL.TEMP1I4)):
==> \************************************
==> \ ELECTRONIC JOURNAL STOP
==> \************************************
GL.PRTLINE$ = " " + \ build total print line
TD.TDSC$(103) + " " + \
?FORMAT.AMOUNT$(GL.TEMP1I4) :\
CALL PRINTER(PRD0J1C2) :\ print it
LWAY.INIT = GL.BALDUE - \ init amt = trans balance
LWAY.FEES + \
GL.TAX(1) + GL.TAX(2) + \ plus taxes
GL.TAX(3) + GL.TAX(4) + \
GL.TAXMAN !

GL.BALDUE = LWAY.PMT ! update balance due


GL.TAXMAN = 0 ! clear manual taxes due
FOR I = 1 TO 4 !
GL.TAX(I) = 0 ! clear auto taxes due
GL.TAXTOT(I) = 0 ! clear taxable totals
NEXT I !

END SUB

V1R0 IBM 4690 Electronic Journal A-35


Created on 6/6/97
Changes to EGHTMAIN

In EGHTMAIN add the following external reference definitions:


!****************************************************************
! ELECTRONIC JOURNAL START
!****************************************************************
! FUNCTION: Journal.Init
!****************************************************************
FUNCTION Journal.Init(SessionNumber) EXTERNAL
INTEGER*2 SessionNumber
FEND

!****************************************************************
! ELECTRONIC JOURNAL STOP
!****************************************************************

After the open of the journal station insert a call to Journal.Init. The parameter
passed to Journal.Init is a session number that must not be used anywhere
else in the terminal sales application.

OPEN "SJ:" AS SESS.PRINTSJ ! Open journal printer driver

!***************************************************************
! ELECTRONIC JOURNAL START
!***************************************************************
CALL Journal.Init(95)

!***************************************************************
! ELECTRONIC JOURNAL STOP
!***************************************************************

V1R0 IBM 4690 Electronic Journal A-36


Created on 6/6/97
Changes to EGHTRCAL

In EGHTRCAL add the following external reference definitions:

!****************************************************************
! ELECTRONIC JOURNAL START
!****************************************************************
! FUNCTION: JOURNAL.TOTAL
!****************************************************************
! called as total is about to be printed
!****************************************************************
FUNCTION JOURNAL.TOTAL(TOTAL.AMT$) EXTERNAL
STRING TOTAL.AMT$
FEND

!****************************************************************
! ELECTRONIC JOURNAL STOP
!****************************************************************

In the SUB RECALL in the END.OF.TRANS routine insert the code that appears
in bold text: (marked with ==>)
END.OF.TRANS:

CALL EXTRACT1(GL.TEMP1$,1,GL.TRANPROG) ! Transaction in progress


CALL EXTRACT1(GL.TEMP1$,2,GL.TRANTYPE) ! Trantype as integer
CALL EXTRACT1(GL.TEMP1$,3,GL.CKOTPROG) ! Checkout in progress
CALL EXTRACT1(GL.TEMP1$,4,GL.TOTALED) ! Checkout totaled flag
CALL EXTRACT1(GL.TEMP1$,5,GL.DRWRFLAG) ! Tender open drawer flag
CALL EXTRACT1(GL.TEMP1$,6,GL.TENDPROG) ! Tender in progress flag
CALL EXTRACT1(GL.TEMP1$,7,GL.NEGBALDUE) ! Tender negative bal due flag
CALL EXTRACT1(GL.TEMP1$,8,GL.MOREITEM) ! Item requested in tender state
CALL EXTRACT1(GL.TEMP1$,9,GL.TRAINING) ! Training mode flag
CALL EXTRACT1(GL.TEMP1$,10,GL.REENTRY) ! Reentry mode flag
CALL EXTRACT1(GL.TEMP1$,11,GL.TAXFLAG) ! Checkout tlog tax flag
CALL EXTRACT1(GL.TEMP1$,12,GL.DISFLAG) ! Checkout tlog discount flag
CALL EXTRACT1(GL.TEMP1$,13,GL.TENDTYP) ! Tender type
CALL EXTRACT1(GL.TEMP1$,14,GL.LAYAWAY) ! Layaway in progress flag
CALL EXTRACT4(GL.TEMP1$,15,GL.TEMP1I4) ! Four byte integer work field
CALL EXTRACT4(GL.TEMP1$,19,GL.BALDUE) ! Checkout balance due
CALL EXTRACT4(GL.TEMP1$,23,GL.TENDDUE) ! Tender balance due
CALL EXTRACT4(GL.TEMP1$,27,GL.STAMPTAX(1)) ! Stampable taxable totals
CALL EXTRACT4(GL.TEMP1$,31,GL.STAMPTAX(2)) ! Stampable taxable totals
CALL EXTRACT4(GL.TEMP1$,35,GL.STAMPTAX(3)) ! Stampable taxable totals
CALL EXTRACT4(GL.TEMP1$,39,GL.STAMPTAX(4)) ! Stampable taxable totals
CALL EXTRACT4(GL.TEMP1$,43,GL.STAMPTOT) ! Stampable total
CALL EXTRACT4(GL.TEMP1$,47,GL.TENDSTPTOT) ! Tender stampable total
CALL EXTRACT4(GL.TEMP1$,51,GL.TENDAMT) ! Checkout tender amount
CALL EXTRACT4(GL.TEMP1$,55,GL.CHANGE) ! Cash change
CALL EXTRACT4(GL.TEMP1$,59,GL.FSCHANGE) ! Food stamp change
CALL EXTRACT4(GL.TEMP1$,63,GL.TRANFSCHG) ! Tender trans food stamp
change

V1R0 IBM 4690 Electronic Journal A-37


Created on 6/6/97
CALL EXTRACT4(GL.TEMP1$,67,GL.TAXTOT(1)) ! Taxable total array - plans
A-D
CALL EXTRACT4(GL.TEMP1$,71,GL.TAXTOT(2)) ! Taxable total array - plans
A-D
CALL EXTRACT4(GL.TEMP1$,75,GL.TAXTOT(3)) ! Taxable total array - plans
A-D
CALL EXTRACT4(GL.TEMP1$,79,GL.TAXTOT(4)) ! Taxable total array - plans
A-D
CALL EXTRACT4(GL.TEMP1$,83,GL.TAX(1)) ! Tax amount array - plans A-D
CALL EXTRACT4(GL.TEMP1$,87,GL.TAX(2)) ! Tax amount array - plans A-D
CALL EXTRACT4(GL.TEMP1$,91,GL.TAX(3)) ! Tax amount array - plans A-D
CALL EXTRACT4(GL.TEMP1$,95,GL.TAX(4)) ! Tax amount array - plans A-D
CALL EXTRACT4(GL.TEMP1$,99,GL.TAXDELTA(1)) ! Tax amount change- plans
A-D
CALL EXTRACT4(GL.TEMP1$,103,GL.TAXDELTA(2)) ! Tax amount change- plans
A-D
CALL EXTRACT4(GL.TEMP1$,107,GL.TAXDELTA(3)) ! Tax amount change- plans
A-D
CALL EXTRACT4(GL.TEMP1$,111,GL.TAXDELTA(4)) ! Tax amount change- plans
A-D
CALL EXTRACT4(GL.TEMP1$,115,GL.TAXM) ! Tax amount - manual tax
CALL EXTRACT4(GL.TEMP1$,119,GL.TAXMAN) ! Tax total - manual tax
CALL EXTRACT4(GL.TEMP1$,123,GL.CPNAMT) ! Coupon amt from validation
CALL EXTRACT4(GL.TEMP1$,127,GL.CPNTAX(1)) ! Coupon taxes from validation
CALL EXTRACT4(GL.TEMP1$,131,GL.CPNTAX(2)) ! Coupon taxes from validation
CALL EXTRACT4(GL.TEMP1$,135,GL.CPNTAX(3)) ! Coupon taxes from validation
CALL EXTRACT4(GL.TEMP1$,139,GL.CPNTAX(4)) ! Coupon taxes from validation
CALL EXTRACT4(GL.TEMP1$,143,GL.DISC1) ! Employee item discount
CALL EXTRACT4(GL.TEMP1$,147,GL.DISC2) ! Club 1 item discount
CALL EXTRACT4(GL.TEMP1$,151,GL.DISC3) ! Club 2 item discount
CALL EXTRACT4(GL.TEMP1$,155,GL.TRAINTOT) ! Accum of training trans
CALL EXTRACT4(GL.TEMP1$,159,GL.ERRCODEX) ! Terminal error code in hex
CALL EXTRACT4(GL.TEMP1$,163,GL.BALAMT) ! Balance due amount

GL.PRTLINE$ = " " + \ build subtotal prt line


TD.TDSC$(104) + \
" " + \
?FORMAT.AMOUNT$(GL.BALDUE) !
CALL PRINTER (PRD0J1C2) ! print subtotal prt line

IF K > 0 THEN \
BEGIN
FOR L = 0 TO K-1
LOOP = TAXARR(L)
GL.TAXFLAG = VAL(UNPACK$(MID$(TL.ARRAY$(LOOP),2,1))) ! flag
GL.TAXM = VAL(UNPACK$(MID$(TL.ARRAY$(LOOP),3,4))) ! tax amount
IF GL.TAXFLAG AND 01H THEN \
GL.TEMP2I1 = 3 \
ELSE \
IF GL.TAXFLAG AND 02H THEN \
GL.TEMP2I1 = 2 \
ELSE \
IF GL.TAXFLAG AND 04H THEN \
GL.TEMP2I1 = 1 \
ELSE \
IF GL.TAXFLAG AND 08H THEN \
GL.TEMP2I1 = 0
IF GL.TAXFLAG AND 010H THEN \
GL.PRTLINE$ = " "+ \ build tax line
TD.TDSC$(149)+" "+ \
?FORMAT.AMOUNT$(GL.TAXM) :\
CALL PRINTER (PRD0J1C1) :\ print it
ELSE \
GL.PRTLINE$ = " "+ \ build tax line
TX.DESC$(GL.TEMP2I1) + \
RIGHT$(?FORMAT.AMOUNT$(GL.TAXM),8) :\
CALL PRINTER (PRD0J1C1) ! print it
NEXT L
ENDIF

V1R0 IBM 4690 Electronic Journal A-38


Created on 6/6/97
GL.TEMP1I4 = GL.BALDUE+ \
GL.TAX(1) + GL.TAX(2)+ \
GL.TAX(3) + GL.TAX(4)+ \
GL.TAXMAN !
==> !************************************
==> ! ELECTRONIC JOURNAL START
==> !************************************
==> CALL JOURNAL.TOTAL(?FORMAT.AMOUNT$(GL.TEMP1I4))
==> !************************************
==> ! ELECTRONIC JOURNAL STOP
==> !************************************

GL.PRTLINE$ = " " + \ build total print line


TD.TDSC$(103) + " " + \
?FORMAT.AMOUNT$(GL.TEMP1I4) !
CALL PRINTER (PRD0J1C2) ! print it
GL.DISPLINE$ = TD.TDSC$(104) ! build display line 1
CALL DISPLAY (1,1,20) ! display it
CALL DISPLAY2(1,1,20) ! display it
GL.DISPLINE$ = " " + \ build display line 2
?FORMAT.AMOUNT$(GL.TENDDUE) !
CALL DISPLAY (2,5,16) ! display it
CALL DISPLAY2(2,5,16) ! display it
GL.SHOPLINE$ = \
?FORMAT.AMOUNT$(GL.TENDDUE) ! build shopper line

IF I > 0 THEN \
BEGIN
FOR J = 0 TO I-1
LOOP = TENDARR(J)
GL.TENDTYP = VAL(UNPACK$(MID$(TL.ARRAY$(LOOP),2,1))) ! type
GL.TEMP1I1 = VAL(UNPACK$(MID$(TL.ARRAY$(LOOP),3,1))) ! flag
GL.TENDAMT = VAL(UNPACK$(MID$(TL.ARRAY$(LOOP),4,4))) ! amount
IF GL.TEMP1I1 AND 08H THEN \
GL.TENDAMT = -GL.TENDAMT !
GL.PRTLINE$ = " " + \ build tender prt line
SO.TENDDESC$(GL.TENDTYP) + \
?FORMAT.AMOUNT$(GL.TENDAMT) !
CALL PRINTER (PRD0J1C1) ! print it
NEXT J
ENDIF

DIM TENDARR(0)
DIM TAXARR(0)
GL.INDICAT1 = GL.INDICAT1 AND 0FFFBH ! turn off suspend flg
GL.RECALL = GL.ON

IF GL.TRAINING = GL.OFF THEN \ if not training


DELREC SESS.SD; SD.KEY$ ! delete record from VP file

EXIT SUB

V1R0 IBM 4690 Electronic Journal A-39


Created on 6/6/97
Changes to EGHTSUBB

In EGHTSUBB add the following external reference definitions:

!****************************************************************
! ELECTRONIC JOURNAL START
!****************************************************************
! Prtline is 40 bytes long.
! The first two bytes contain the number of lines to be skipped
! after printing.
! The remaining 38 bytes are the text to be printed
!
! If Journal returns a Null string, then don't print to the
! paper journal, otherwise do.
!****************************************************************

FUNCTION Journal(PrtLine) EXTERNAL


STRING Journal
STRING PrtLine
FEND

!****************************************************************
! called as header is about to be printed--this is the start
! of a transaction.
!****************************************************************
FUNCTION JOURNAL.HEADER EXTERNAL
FEND

!****************************************************************
! called after trailer has been printed--this is the end
! of a transaction.
!****************************************************************
FUNCTION JOURNAL.TRAILER EXTERNAL
FEND
!****************************************************************
! called at keyboard timeout if between transactions
! if the terminal has returned online any spooled
! transactions will be written to the controller
!****************************************************************
FUNCTION CHECK.OFFLINE EXTERNAL
FEND

!****************************************************************
! ELECTRONIC JOURNAL STOP
!****************************************************************

V1R0 IBM 4690 Electronic Journal A-40


Created on 6/6/97
In the PRINTER subroutine add the bold text: (marked with ==>)
SUB PRINTER (PRT.PARM) PUBLIC
INTEGER*1 PRT.DISPFLAG
INTEGER*2 PRT.PARM,PRT.SAVPARM,PRT.TEMPI2
INTEGER*4 PRT.WRKPARM,PRT.TEMPI4
STRING PRT.FORM$,PRT.DISPLAY$

GL.PRTLINE$ = LEFT$(GL.PRTLINE$ + GL.BLANKS$,38)

IF GL.CRTODI = GL.ON THEN \ if all CR go to DI


PRT.SAVPARM = (PRT.PARM AND 00FFH) :\ clear DI parm bits
PRT.TEMPI2 = (PRT.SAVPARM AND 000FH) :\ get CR parms
PRT.TEMPI2 = PRT.TEMPI2 * 256 :\ shift left to DI bits
PRT.SAVPARM = (PRT.SAVPARM OR PRT.TEMPI2) :\ combine DI & SJ parms
PRT.SAVPARM = (PRT.SAVPARM AND 0FF0H) :\ clear CR parms
ELSE \ ELSE
PRT.SAVPARM = PRT.PARM ! use passed parm

IF (PRT.SAVPARM AND 0800H) THEN \ di requested ?


BEGIN
PUTLONG SESS.PRINTDI,00000060H ! init DI
!AIR69802
IF ((PRT.SAVPARM AND 0700H)=0700H) THEN \ if eject requested
IF GL.PRTLINE$=LEFT$(GL.BLANKS$,38) THEN\ if blanks for eject
GOSUB PRT.EJECT :\ do eject only
EXIT SUB !
!EIR69802

PRT.TESTDI:
PRT.TEMPI4 = GETLONG(SESS.PRINTDI) ! get printer status
IF ((PRT.TEMPI4 AND 00000010H) <> 0) AND \ if doc inserted and
((PRT.TEMPI4 AND 00000020H) = 0) THEN \ di throat closed
GOSUB PRT.RSTDISP :\ restore disp if needed
ELSE \
IF PRT.DISPFLAG = GL.OFF THEN \ first pass only
begin !
TCLOSE SESS.PRINTCR ! wait for all cr prts
WRITE FORM "C38A00"; #SESS.PRINTCR; \ blank print to over-
LEFT$(GL.BLANKS$,38) ! ride tclose problem
ENDIF :\
GOSUB PRT.SAVDISP :\ save disp if needed
GL.DISPLINE$ = "C013 "+TM.TMSG$(13) :\ insert form msg
CALL DISPLAY (1,1,40) :\ display it
WAIT ;500 :\ wait
GOTO PRT.TESTDI ! try again
ENDIF

IF (PRT.SAVPARM AND 0008H) THEN \ if CR requested


BEGIN
PRT.TEMPI4 = GETLONG(SESS.PRINTDI) ! get printer status
IF PRT.TEMPI4 AND 00000010H THEN \ if doc inserted
GOSUB PRT.EJECT ! eject document
ENDIF

PRT.TEMPI2 = PRT.SAVPARM AND 0088H ! test parm for cr and sj


IF PRT.TEMPI2 = 0088H THEN \ cr and sj req'd
IF GL.PRTFLAG THEN \ direction flag on ?
GL.PRTFLAG = GL.OFF :\ turn it off
GOSUB PRINTSJ :\ do SJ
GOSUB PRINTCR \ do CR
ELSE \
GL.PRTFLAG = GL.ON :\ turn it on
GOSUB PRINTCR :\ do CR
GOSUB PRINTSJ \ do SJ

V1R0 IBM 4690 Electronic Journal A-41


Created on 6/6/97
ELSE \
PRT.TEMPI2 = PRT.SAVPARM AND 0880H :\ test parm for DI and SJ
IF PRT.TEMPI2 = 0880H THEN \ DI and SJ requested
IF GL.PRTFLAG THEN \ direction flag on ?
GL.PRTFLAG = GL.OFF :\ turn it off
GOSUB PRINTSJ :\ do SJ
GOSUB PRINTDI :\ do DI
ELSE \
GL.PRTFLAG = GL.ON :\ turn it on
GOSUB PRINTDI :\ do DI
GOSUB PRINTSJ :\ do SJ
ELSE \
IF (PRT.SAVPARM AND 0008H) THEN \ cr only
GOSUB PRINTCR \ do CR
ELSE \
IF (PRT.SAVPARM AND 0080H) THEN \ sj only
GOSUB PRINTSJ \ do SJ
ELSE \
IF (PRT.SAVPARM AND 0800H) THEN \ di only
GOSUB PRINTDI ! do DI

EXIT SUB

PRINTCR:
PRT.WRKPARM = PRT.SAVPARM AND 0007H ! get cr feed bits
IF PRT.WRKPARM = 7 THEN \ if eject (7 feeds)
PRT.WRKPARM = 8 ! need 8 for eject
PRT.FORM$ = "C38A0" + STR$(PRT.WRKPARM) ! format string
WRITE FORM PRT.FORM$; # SESS.PRINTCR; GL.PRTLINE$ ! prt at CR
!AIR81483
IF MONITORING = GL.ON THEN \ if term monitor on
CALL MONITOR ("P",RIGHT$(PRT.FORM$,2)+GL.PRTLINE$) ! write data
!EIR81483
RETURN

PRINTSJ:
PRT.WRKPARM = PRT.SAVPARM AND 0070H ! get sj feed bits
PRT.WRKPARM = SHIFT(PRT.WRKPARM,4) ! shift sj line feeds
IF PRT.WRKPARM = 7 THEN \ if eject (7 feeds)
PRT.WRKPARM = 8 ! need 8 for eject
PRT.FORM$ = "C38A0" + STR$(PRT.WRKPARM) ! format string
==> !**********************************************************
==> ! ELECTRONIC JOURNAL START
==> !**********************************************************
==> IF Journal(RIGHT$("00"+STR$(PRT.WRKPARM),2) + \
==> GL.PRTLINE$) <> "" THEN \ !
==> WRITE FORM PRT.FORM$; # SESS.PRINTSJ; GL.PRTLINE$ ! prt at SJ
==> !**********************************************************
==> ! ELECTRONIC JOURNAL STOP
==> !**********************************************************
RETURN

PRINTDI:
IF ((PRT.SAVPARM AND 0700H)=0700H) THEN \ if eject requested
BEGIN !
PRT.WRKPARM = 1 ! set 1 line feed
ENDIF \
ELSE \
BEGIN !
PRT.WRKPARM = PRT.SAVPARM AND 0700H ! get di feed bits
PRT.WRKPARM = SHIFT(PRT.WRKPARM,8) ! shift di line feeds
ENDIF !

PRT.FORM$ = "C38A0" + STR$(PRT.WRKPARM) ! format string


WRITE FORM PRT.FORM$; # SESS.PRINTDI; GL.PRTLINE$ ! prt at DI

V1R0 IBM 4690 Electronic Journal A-42


Created on 6/6/97
!AIR81483
IF (MONITORING = GL.ON) AND \ if term monitor on
(GL.CRTODI = GL.ON) THEN \ and document trans
CALL MONITOR ("P",RIGHT$(PRT.FORM$,2)+GL.PRTLINE$) ! write data
!EIR81483
IF ((PRT.SAVPARM AND 0700H)=0700H) THEN \ if eject requested
BEGIN !
GOSUB PRT.EJECT

RETURN

PRT.EJECT:
PRT.TEMPI4 = GETLONG(SESS.PRINTDI) ! get printer status
IF ((PRT.TEMPI4 AND 00000010H) <> 0) THEN \ if doc inserted
IF PRT.DISPFLAG = GL.OFF THEN \ first pass only
begin !
TCLOSE SESS.PRINTDI ! wait for all di prts
WRITE FORM "C38A00"; #SESS.PRINTCR; \ blank print to over-
LEFT$(GL.BLANKS$,38) ! ride tclose problem
ENDIF :\
GOSUB PRT.SAVDISP :\ save display if needed
GL.DISPLINE$= "C034 "+TM.TMSG$(34) :\ remove form msg
CALL DISPLAY (1,1,40) :\ display it
WAIT ;500 :\ wait
GOTO PRT.EJECT \ try again
ELSE \
GOSUB PRT.RSTDISP :\ restore disp if needed
PUTLONG SESS.PRINTCR,00000020H :\ do not allow doc
WRITE FORM "C38A01"; #SESS.PRINTCR; \ blank print to open
LEFT$(GL.BLANKS$,38) ! DI throat !AIR69901
ENDIF !
RETURN

PRT.SAVDISP:
IF PRT.DISPFLAG = GL.OFF THEN \ disp not saved ?
LOCATE # SESS.DISPLAY; 1, 1 :\ locate pos 1
READ FORM "C40"; # SESS.DISPLAY; PRT.DISPLAY$:\ read display
LOCATE # SESS.DISPLAY; 1, 1 :\ reset pointer
PRT.DISPFLAG = GL.ON ! set saved on
RETURN

PRT.RSTDISP:
IF PRT.DISPFLAG = GL.ON THEN \ disp saved ?
LOCATE # SESS.DISPLAY; 1, 1 :\ locate pos 1
WRITE FORM "C40" ; # SESS.DISPLAY; PRT.DISPLAY$:\ restore disp
PRT.DISPFLAG = GL.OFF ! set saved off
RETURN

END SUB

V1R0 IBM 4690 Electronic Journal A-43


Created on 6/6/97
This is a copy of the HEADER subroutine. Add the lines that are in bold text:
(marked with ==>)
SUB HEADER PUBLIC

IF GL.ENDORSDI = GL.ON THEN \ If request from ENDORSE


GOTO HDR.NOMSG ! skip messages

==> !***********************************************************
==> ! ELECTRONIC JOURNAL START
==> !***********************************************************
==> CALL JOURNAL.HEADER
==> !***********************************************************
==> ! ELECTRONIC JOURNAL STOP
==> !***********************************************************

IF TO.TFLAG2 AND 040H THEN \ If topmsg1 flag on


GL.PRTLINE$ = TO.TOPMSG1$ :\ get msg from options
IF NOT (TO.TFLAG2 AND 020H) THEN \ If topmsg2 flag off
CALL PRINTER (PRD0J0C2) \ print it with 2 feeds
ELSE \
CALL PRINTER (PRD0J0C1) ! print it with 1 feed

IF TO.TFLAG2 AND 020H THEN \ if topmsg2 flag on


GL.PRTLINE$ = TO.TOPMSG2$ :\ get msg from options
CALL PRINTER (PRD0J0C2) ! print it with 2 feeds

HDR.NOMSG:
GL.TEMP1$ = UNPACK$(SP.SPID$) ! get s'per id
GL.TEMP1$ = RIGHT$(GL.TEMP1$,GL.SPERLEN) ! sig digits only
GL.TEMP1$ = LEFT$(GL.TEMP1$+GL.BLANKS$,10) ! pad right w/ blanks
GL.TEMP2$ = RIGHT$("00"+STR$(GL.TRANTYPE),2) ! tran type
GL.TEMP3$ = RIGHT$("000"+STR$(GL.TRANSNUM),4)! tran number
GL.TEMP4$ = RIGHT$(GL.TERMNUM$,3) ! terminal number

GL.PRTLINE$ = " "+GL.TEMP1$+" "+GL.TEMP2$+" "+GL.TEMP3$ \


+" "+SO.STORENUM$+" "+GL.TEMP4$+" "

IF GL.ENDORSDI = GL.ON THEN \ If request from ENDORSE


CALL PRINTER (PRD2J0C0) \ print at di
ELSE \
CALL PRINTER (PRD0J1C2) ! print at sj/cr

IF GL.TRAINING = GL.ON THEN \ training mode


GL.PRTLINE$ = TD.TDSC$(142) :\ get training banner
IF GL.ENDORSDI = GL.ON THEN \ If request from ENDORSE
CALL PRINTER (PRD1J0C0) \ print at di
ELSE \
CALL PRINTER (PRD0J1C2) ! print at sj/cr

IF GL.REENTRY = GL.ON THEN \


GL.PRTLINE$ = TD.TDSC$(143) :\ get reentry banner
CALL PRINTER (PRD0J1C1) ! print it

END SUB

V1R0 IBM 4690 Electronic Journal A-44


Created on 6/6/97
This is a copy of the TRAILER subroutine. Add the lines that are in bold text:
(marked with ==>)
SUB TRAILER PUBLIC

IF GL.TRAINING = GL.ON THEN \ if training mode


GL.PRTLINE$ = TD.TDSC$(142) :\ get training banner
IF GL.ENDORSDI = GL.ON THEN \ if endorsement request
CALL PRINTER (PRD1J0C0) \ print at di
ELSE \
CALL PRINTER (PRD0J1C2) ! print at sj/cr !AIR71343

IF GL.REENTRY = GL.ON THEN \ if reentry mode


GL.PRTLINE$ = TD.TDSC$(143) :\ get reentry banner
CALL PRINTER (PRD0J1C1) ! print it

IF (GL.TRANTYPE > 19) OR \ If admin trans or


((GL.INDICAT1 AND 10H)=10H) OR \ if signoff or
(GL.ENDORSDI = GL.ON) THEN \ endorsement request
GOTO TRL.NOMSG ! skip messages

IF TO.TFLAG2 AND 010H THEN \ If botmsg1 flag on


GL.PRTLINE$ = TO.BOTMSG1$ :\ build line
CALL PRINTER (PRD0J0C1) ! print it

IF TO.TFLAG2 AND 008H THEN \ If botmsg2 flag on


GL.PRTLINE$ = TO.BOTMSG2$ :\ build line
CALL PRINTER (PRD0J0C1) ! print it

TRL.NOMSG:

GL.PRTLINE$ = ?DATETIME$ ! Get time/date line

IF GL.ENDORSDI = GL.ON THEN \ if endorsement request


CALL PRINTER (PRD2J0C0) \ print at di
ELSE \
CALL PRINTER (PRD0J2CE) ! print at sj/cr

==> !*******************************************************
==> ! ELECTRONIC JOURNAL START
==> !*******************************************************
==> CALL JOURNAL.TRAILER
==> !*******************************************************
==> ! ELECTRONIC JOURNAL STOP
==> !*******************************************************
END SUB

V1R0 IBM 4690 Electronic Journal A-45


Created on 6/6/97
This is a copy of the INPTWAIT subroutine. Add the lines that are in bold text:
(marked with ==>)

SUB INPTWAIT (INP.STATE) PUBLIC


INTEGER*1 I,INP.CLRFLAG
INTEGER*2 INP.STATE,INP.LOCKTIME,INP.UPDTIME
INTEGER*2 INP.PACETIME,DS.PACING ! !IR76545
STRING INP.DATA$ !IR81483

!AIR90602
INTEGER*2 bannering ! 1 = I am bannering
INTEGER*2 ban.inp.state ! input state
INTEGER*2 ban.work ! work field
INTEGER*2 ban.length ! length of banner message
INTEGER*2 ban.msg.pos ! position in the banner I'm at
INTEGER*2 ban.first.pass ! first pass switch
INTEGER*2 ban.steps.per.sec ! steps per second
INTEGER*2 wait.time ! wait time
INTEGER*2 inp.bantime ! banner wait time counter
STRING ban.message$ ! banner message
!EIR90602

INP.LOCKTIME = 0

!AIR90602
REM********************************************************
REM set up for bannering
REM********************************************************
ban.inp.state=inp.state ! save input state
gosub setup.banner ! go setup banner
!EIR90602

GL.TEMP1I4 = GETLONG(SESS.KEYBOARD) ! get keyboard status


IF GL.TEMP1I4 AND 01000000H THEN \ if keyboard locked
IF GL.PRIORITY = GL.ON THEN \
UNLOCKDEV SESS.KEYBOARD,INP.STATE,PRIORITY \
ELSE \
UNLOCKDEV SESS.KEYBOARD,INP.STATE !

IF GL.MSR.INPUT = GL.ON THEN \ if msr input valid


IF GL.MSR.OPEN = GL.ON THEN \ if msr is opened
UNLOCKDEV SESS.MSR ! unlock msr
!AIR81483
IF MONITORING = GL.ON THEN \ if term monitor on
begin !
LOCATE # SESS.DISPLAY; 1, 1 ! locate display pos 1
READ FORM "C40"; # SESS.DISPLAY; INP.DATA$ ! read display
CALL MONITOR ("D",INP.DATA$) ! write to monitor file
ENDIF
!EIR81483

INP.WAIT:
GL.ERRCODE$ = GL.NULL$ ! clear error code !IR70452
IF (GL.MSR.INPUT = GL.ON) AND \ if msr input valid and
(GL.MSR.OPEN = GL.ON) THEN \ msr is opened
WAIT SESS.KEYBOARD,SESS.MSR; wait.time \ wait for kybd !CIR90602
ELSE \
WAIT SESS.KEYBOARD; wait.time ! wait for kybd input !CIR90602

IF EVENT% = SESS.KEYBOARD THEN \ if keyboard satsified wait


GOTO INP.KYBD.RECD ! go process keyboard input

IF EVENT% = SESS.MSR THEN \ if msr satisfied wait


GOTO INP.MSR.RECD ! go process msr input

!AIR33231 8/7/96 - Added MICR support.

V1R0 IBM 4690 Electronic Journal A-46


Created on 6/6/97
! if account number state and MICR present then ...
IF (INP.STATE = 17) AND (MICR.SUPPORT) THEN BEGIN
GL.ERRCODE$ = GL.NULL$ ! clear error code
GL.ACCTNUM$ = GL.NULL$ ! assume no data read
CALL MICR.READ ! read MICR data
IF GL.ERRCODE$ <> GL.NULL$ THEN BEGIN ! error occurred
IP.MAJOR = INP.STATE ! force state
GOSUB INP.REUNLOCK ! re-unlock
GOTO INP.WAIT ! wait for input again
ENDIF ELSE IF GL.ACCTNUM$ <> GL.NULL$ THEN BEGIN ! acct num read
GL.TEMP1$ = CHR$(KB.ENTER)+\ ! place enter key with data
GL.ACCTNUM$ ! place data into kybd buffer
GL.TEMP2$ = GL.NULL$ ! clear rest of kybd buffer
GL.TEMP3$ = GL.NULL$ !
GL.TEMP4$ = GL.NULL$ !
GL.TEMP5$ = GL.NULL$ !
GL.TEMP6$ = GL.NULL$ !
GL.TEMP7$ = GL.NULL$ !
GL.TEMP8$ = GL.NULL$ !
GL.TEMP9$ = GL.NULL$ !
GL.TEMP10$ = GL.NULL$ !
GL.TEMP11$ = GL.NULL$ !
LOCKDEV SESS.KEYBOARD, PURGE ! relock keyboard
GOTO INP.RECD ! go process input
ENDIF
ENDIF
!EIR33231 8/7/96 - End modification.

INP.LOCKTIME = INP.LOCKTIME + 1 ! accumulate wait times


INP.UPDTIME = INP.UPDTIME + 1 ! accumulate wait times
!SIR90602
inp.bantime = inp.bantime + 1 ! accumulate wait times
if inp.bantime>10000 then inp.bantime=gl.ban.start.delay+1 ! overflow ?
!EIR90602
==> !*****************************************************
==> ! ELECTRONIC JOURNAL START
==> !*****************************************************
==> IF TL.NEXT = 2 THEN CALL CHECK.OFFLINE !ELECTRONIC JOURNAL
==> !*****************************************************
==> ! ELECTRONIC JOURNAL STOP
==> !*****************************************************
AIR76545
REM********************************************************
REM TERMINAL IN-MEMORY LOGGING CODE
REM********************************************************
IF GL.MEMLOG THEN \ if currently logging in memory
IF TL.NEXT = 1 THEN \ if between transactions
INP.PACETIME = INP.PACETIME + 1 :\ accumulate wait times
DS.PACING = 05 : \
IF (INP.PACETIME > (DS.PACING*ban.steps.per.sec)) THEN \ if time to despool
!CIR90602
INP.PACETIME = 0 :\
CALL DESPOOL ! another, do it.
REM********************************************************
!EIR76545

IF (GL.LOCKTIME > 0) AND \ if auto signoff wanted


(INP.LOCKTIME > (GL.LOCKTIME*ban.steps.per.sec)) THEN \ and time exceeded
!CIR90602
GL.TIMEOUT = GL.ON :\ set timeout occurred
GOTO INP.EXIT !

V1R0 IBM 4690 Electronic Journal A-47


Created on 6/6/97
IF INP.UPDTIME > 120*ban.steps.per.sec THEN \ if two minutes has passed
!CIR90602
INP.UPDTIME = 0 :\ reset timer
IF GL.CKOTPROG = GL.OFF THEN \ if ckeckout not in progress
CALL TERMSTAT(0) :\ go for updates
IF GL.ERRCODE$ <> "TO" THEN \ if we are online
CALL EXTRACT1(AC.OFFLINE$, \ get offline string flag
AC.OFF.FLAG,GL.TEMP1I1) :\
\IR78224 IF GL.TEMP1I1 AND 40H THEN \ if we have offline totals
IF ((GL.TEMP1I1 AND 40H)=40H) AND \ if off'l tots !IR78224
(GL.MEMLOG = GL.OFF) THEN \ not ram logging !IR78224
BEGIN !
CALL LOGOFFLINE ! build offline log strings
CALL WRITE.TLOG ! wr. matrix to log !IR72440
TL.ARRAY$(TL.NEXT-1) = GL.NULL$ ! free up storage !IR76545
TL.NEXT = 1 ! !IR76545
IF GL.ERRCODE$ = GL.NULL$ THEN \ if successful write
begin ! !IR78224
AC.OFFLINE$ = \ clear offline totals
STRING$(508,PACK$("00")) !
CALL HTWRITE.OFFLINE ! update htots !IR78224
ENDIF ! !IR78224
ENDIF !
!AIR90602
REM********************************************************
REM bannering code
REM********************************************************
if bannering=1 then \ right state ?
if gl.msg.changed=0 then begin ! msgs not changed ?
if inp.bantime>gl.ban.start.delay then BEGIN ! delayed enough ?
if ban.first.pass=1 then begin ! first time ?
if gl.ban.size<20 then begin ! need to clear line ?
old.line=gl.ban.line ! set line
old.disp=gl.ban.disp ! set disp
gosub display.line ! go clear line
endif
ban.first.pass=0 ! reset switch
endif
gl.displine$=mid$(ban.message$,ban.msg.pos,gl.ban.size) ! get msg
gosub display.line ! go display line
ban.msg.pos=ban.msg.pos+1 ! step to next position
if ban.msg.pos=ban.length-gl.ban.size then begin ! at end ?
CALL TERMSTAT(0) ! go for updates
if gl.ban.msg.nmbr=101 then begin ! Sequential messages ?
if times.displayed=gl.ban.disp.times then begin ! enough times ?
gosub get.next.msg.nmbr :\ yes - go get next nmbr
ban.message$=left$(ban.message$,ban.length)+ \ add extra
left$(gl.ban.msg$(gl.msg.to.do),gl.ban.size)
times.displayed=1 ! reset counter
endif else \ not enough times
times.displayed=times.displayed+1 ! count this time
endif
endif
if ban.msg.pos>ban.length then begin ! at end ?
ban.msg.pos=gl.ban.size ! yes - reset
if gl.ban.msg.nmbr>100 then \ Sequential ?
gosub construct.msg ! yes - build new msg
endif
ENDIF
ENDIF else begin ! msgs changed
gosub display.line ! go clear old line
gosub setup.banner ! go initialize
endif else begin ! not bannering
wait.time=995 ! set wait time
ban.steps.per.sec=1 ! set step rate
if gl.msg.changed=1 then \ new files ?
gosub setup.banner ! go initialize
endif
!EIR90602

V1R0 IBM 4690 Electronic Journal A-48


Created on 6/6/97
GOTO INP.WAIT

INP.MSR.RECD:

GL.ERRCODE$ = GL.NULL$ ! clear error


READ #SESS.MSR; LINE GL.TEMP1$ ! read msr input
IF GL.ERRCODE$ <> GL.NULL$ THEN \ if bad read on msr
LOCKDEV SESS.MSR, PURGE :\ lock msr
UNLOCKDEV SESS.MSR :\ re-unlock msr
GOTO INP.WAIT ! wait again
WRITE FORM "C4,C3"; # SESS.TONE; "1000","1" ! Sound tone
LOCKDEV SESS.MSR, PURGE ! lock msr
LOCKDEV SESS.KEYBOARD, PURGE ! lock keyboard
GL.TEMP1I2 = \ search for carriage return 0D
MATCH(CHR$(13),GL.TEMP1$,1) !
IF GL.TEMP1I2 = 0 THEN \ if no CR
GL.TEMP1I2 = 25 :\ force maximum length
GL.TEMP3$ = GL.NULL$ :\
ELSE \
GL.TEMP3$ = \ expire date =
MID$(GL.TEMP1$,GL.TEMP1I2+3,2) + \ month +
MID$(GL.TEMP1$,GL.TEMP1I2+1,2) :\ year
GL.TEMP3$ = PACK$(GL.TEMP3$) :\ conv BCD to packed
GL.TEMP3$ = UNPACK$(GL.TEMP3$) ! conv packed to ASCII

GL.TEMP1$ = \ use only characters before


LEFT$(GL.TEMP1$,GL.TEMP1I2-1) ! the CR
GL.TEMP1$ = PACK$(GL.TEMP1$) ! conv. BCD to packed
GL.TEMP1$ = UNPACK$(GL.TEMP1$) ! conv. packed to ASCII
GL.TEMP1$ = CHR$(KB.ENTER)+GL.TEMP1$ ! place data into kybd buffer
GL.TEMP2$ = GL.NULL$ ! clear kybd buffer
GL.TEMP3$ = CHR$(KB.ENTER)+GL.TEMP3$ ! place 2nd field into buffer
GL.TEMP4$ = GL.NULL$ ! clear rest of kybd buffers
GL.TEMP5$ = GL.NULL$ !
GL.TEMP6$ = GL.NULL$ !
GL.TEMP7$ = GL.NULL$ !
GL.TEMP8$ = GL.NULL$ !
GL.TEMP9$ = GL.NULL$ !
GL.TEMP10$ = GL.NULL$ !
GL.TEMP11$ = GL.NULL$ !
GOTO INP.RECD ! go process input

INP.KYBD.RECD:

GL.ERRCODE$ = GL.NULL$ ! clear error code !IR70452


READ # SESS.KEYBOARD; GL.TEMP11$,GL.TEMP1$,GL.TEMP2$, \
GL.TEMP3$,GL.TEMP4$,GL.TEMP5$, \
GL.TEMP6$,GL.TEMP7$,GL.TEMP8$, \
GL.TEMP9$,GL.TEMP10$
IF GL.ERRCODE$ <> GL.NULL$ THEN \ if i/o error !IR70452
IP.MAJOR = INP.STATE :\ force state !IR70452
GOSUB INP.REUNLOCK :\ re-unlock !IR70452
GOTO INP.WAIT ! wait !IR70452
INP.RECD:
IF INP.STATE <> 6 THEN \ if not item entry !IR81483
CALL CLRDISP ! clear any prompt
IP.MAJOR = VAL(MID$(GL.TEMP11$,2,4)) ! major state
IP.LAST = VAL(MID$(GL.TEMP11$,6,4)) ! last state
IP.DEVICE$ = MID$(GL.TEMP11$,10,1) ! input device
IP.MANAGERKEY = GL.OFF ! init mgrkey off
IF MID$(GL.TEMP11$,11,1) = "1" THEN \ if flagged as on
IP.MANAGERKEY = GL.ON ! set mgrkey on
IP.KEYEDLABEL = GL.OFF ! init label off
IF MID$(GL.TEMP11$,12,1) = "1" THEN \ if flagged as on
IP.KEYEDLABEL = GL.ON ! set label on
IP.LASTFCODE$ = MID$(GL.TEMP11$,13,1) ! last fcode in sequence

V1R0 IBM 4690 Electronic Journal A-49


Created on 6/6/97
IF LEFT$(GL.TEMP10$,1) = CHR$(73) OR \ not desirable clear OR
((LEFT$(GL.TEMP9$,1)= CHR$(73))AND \ desirable clear but
(LEN(GL.TEMP9$)>1)) THEN \ with data entered
CALL CLRDISP :\ clr display
INP.LOCKTIME = 0 :\ reset timer
GOSUB INP.REUNLOCK :\ reunlock !IR70452
GOTO INP.WAIT ! wait !IR70452

IF GL.MSR.INPUT = GL.ON THEN \ if msr input was also valid


IF GL.MSR.OPEN = GL.ON THEN \ if msr is opened
LOCKDEV SESS.MSR, PURGE ! lock msr

CALL BRKDATA (GL.TEMP1$,IP.FCODE1,IP.DATA1$) ! sep fcode & data


CALL BRKDATA (GL.TEMP2$,IP.FCODE2,IP.DATA2$) !
CALL BRKDATA (GL.TEMP3$,IP.FCODE3,IP.DATA3$) !
CALL BRKDATA (GL.TEMP4$,IP.FCODE4,IP.DATA4$) !
CALL BRKDATA (GL.TEMP5$,IP.FCODE5,IP.DATA5$) !
CALL BRKDATA (GL.TEMP6$,IP.FCODE6,IP.DATA6$) !
CALL BRKDATA (GL.TEMP7$,IP.FCODE7,IP.DATA7$) !
CALL BRKDATA (GL.TEMP8$,IP.FCODE8,IP.DATA8$) !
CALL BRKDATA (GL.TEMP9$,IP.FCODE9,IP.DATA9$) !
CALL BRKDATA (GL.TEMP10$,IP.FCODE10,IP.DATA10$) !

INP.EXIT:

GL.LOCKTIME = 0 ! clear auto signoff value

!AIR90602
if bannering=1 then BEGIN \ right state ?
ban.message$="" ! remove string
bannering=0 ! null switch
old.line=gl.ban.line ! set line
old.disp=gl.ban.disp ! set disp
ban.first.pass=1
gosub display.line ! go clear line
ENDIF
!EIR90602

EXIT SUB

!AIR90602
construct.msg:
gl.ban.display$=gl.ban.msg$(gl.msg.to.do) ! get msg
!AIR93603 ban.work=match("|",gl.ban.display$,1) ! find end char
!AIR93603 if ban.work>1 then gl.ban.display$=left$(gl.ban.display$,ban.work-1) ! remove
extra
ban.message$=string$(gl.ban.size-1," ")+gl.ban.display$ ! pad with blanks
ban.length=len(ban.message$) ! get message length
ban.message$=ban.message$+left$(gl.ban.display$,gl.ban.size) ! add extra
return

get.next.msg.nmbr:
gl.msg.to.do=gl.msg.to.do+1 ! step to next msg
if gl.msg.to.do>10 then \ past last msg ?
gl.msg.to.do=1 ! yes
if gl.ban.msg$(gl.msg.to.do)="" then begin ! null msg ?
loop.limit=1 ! set loop limit
while gl.ban.msg$(gl.msg.to.do)="" and loop.limit<11 ! loop till non-null found
loop.limit=loop.limit+1 ! count this loop
gl.msg.to.do=gl.msg.to.do+1 ! step to next msg
if gl.msg.to.do>10 then \ past last msg ?
gl.msg.to.do=1 ! yes
wend
endif
return

V1R0 IBM 4690 Electronic Journal A-50


Created on 6/6/97
setup.banner:
wait.time=995 ! preset wait time
ban.steps.per.sec=1 ! preset step rate
bannering=0 ! preset switch
if (gl.ban.on.off = 1) AND \ configed "Y" AND
(gl.ban.state=ban.inp.state) AND \ right state AND
((ban.inp.state<>6) OR \ not ITEMENT OR
(gl.ckotprog=gl.off)) then BEGIN ! ckeckout not in progress
bannering=1 ! I'm bannering
ban.steps.per.sec=gl.ban.steps.per.sec
wait.time=944/ban.steps.per.sec ! calc wait time
INP.BANTIME = 0 ! clear time field
ban.msg.pos=1 ! position in the banner message
gosub construct.msg ! go construct banner msg
times.displayed=1 ! reset counter
ban.first.pass=1 ! set first pass
ENDIF
gl.msg.changed=0 ! reset switch
return

display.line:
if ban.first.pass=1 or gl.msg.changed=1 then begin
gl.displine$=string$(20," ") ! blank line
if old.disp=1 then \ oper display ?
call display (old.line,1,20) \ display msg
else \ cust display ?
call display2(old.line,1,20) ! display msg
endif else begin !
if gl.ban.disp=1 then \ oper display ?
call display (gl.ban.line,gl.ban.pos,gl.ban.size) \ display msg
else \ cust display ?
call display2(gl.ban.line,gl.ban.pos,gl.ban.size) ! display msg
old.disp=gl.ban.disp:old.line=gl.ban.line
endif
return
!EIR90602

!AIR70452 The following code was made a Gosub routine for this apar
INP.REUNLOCK:
IF GL.PRIORITY = GL.ON THEN \
UNLOCKDEV SESS.KEYBOARD,IP.MAJOR,PRIORITY \ unlock maj state
ELSE \
GL.TEMP1I4 = GETLONG(SESS.KEYBOARD) :\ get kbd stat !IR70452
IF GL.TEMP1I4 AND 01000000H THEN \ if locked !IR70452
UNLOCKDEV SESS.KEYBOARD,IP.MAJOR ! unlock maj state
RETURN
!EIR70452

END SUB

V1R0 IBM 4690 Electronic Journal A-51


Created on 6/6/97
V1R0 IBM 4690 Electronic Journal A-52
Created on 6/6/97

You might also like