User's Guide: IBM Electronic Journal For 4690 OS, Version 2

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

IBM Electronic Journal

for 4690 OS, Version 2 

User’s Guide
Note

Before using this information and the product it supports, be sure to read the general information under “Notices” on page v.

| Third edition (July, 2000)


| This is the third edition of the IBM Electronic Journal for 4690 OS: User’s Guide. This edition applies to Version 2 of
| the IBM Electronic Journal for 4690 OS, 5697-G45, and to all subsequent releases and modifications until otherwise
| indicated in new editions. This edition was created on 5/30/2000.
®
| Copyright EDJ Enterprises, Inc. 1996, 2000. All rights reserved.
®
| Copyright International Business Machines 1996, 2000. 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.
| A form for readers’ comments appears at the back of this publication. If the form has been removed, address your
| comments to:
| IBM Corporation, Information Development, Department CJMA
| PO Box 12195
| Research Triangle Park, North Carolina, 27709
| USA
| When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any
| way it believes appropriate without incurring any obligation to you.
Contents
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . v

Chapter 1. IBM Electronic Journal for 4690 OS—overview . . . . . . . . 1


Application features . . . . . . . . . . . . . . . . . . . . . . . 1
| What’s new in Version 2? . . . . . . . . . . . . . . . . . . . . . 1
Application functions . . . . . . . . . . . . . . . . . . . . . . . 2
Sizing information . . . . . . . . . . . . . . . . . . . . . . . . 3
Offline operations . . . . . . . . . . . . . . . . . . . . . . . . 4
System requirements . . . . . . . . . . . . . . . . . . . . . . . 5
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Chapter 2. IBM 4690 Electronic Journal—personalization options . . . . . 7


Terminal options . . . . . . . . . . . . . . . . . . . . . . . . . 8
| Host file build . . . . . . . . . . . . . . . . . . . . . . . . . . 9
| End of day . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Chapter 3. IBM Electronic Journal for 4690 OS—tailoring options. . . . . 11


ELF and MCF . . . . . . . . . . . . . . . . . . . . . . . . . 11
| No ELF and no MCF. . . . . . . . . . . . . . . . . . . . . . . 14
MCF and No ELF . . . . . . . . . . . . . . . . . . . . . . . . 15

Chapter 4. IBM Electronic Journal for 4690 OS—Journal review . . . . . 17


REVIEW journal selection . . . . . . . . . . . . . . . . . . . . . 17
Journal list by date . . . . . . . . . . . . . . . . . . . . . . 18
Journal list by register . . . . . . . . . . . . . . . . . . . . . 18
Journal display panel . . . . . . . . . . . . . . . . . . . . . . 18

| Chapter 5. IBM Electronic Journal for 4690 OS file utility . . . . . . . . 21


| QXLT4690 syntax . . . . . . . . . . . . . . . . . . . . . . . . 21
| Examples of using QXLT4690 . . . . . . . . . . . . . . . . . . . 21

Chapter 6. IBM Electronic Journal for 4690 OS integration . . . . . . . 23


Electronic Journal Feature user exits . . . . . . . . . . . . . . . . . 23
General Sales Application . . . . . . . . . . . . . . . . . . . . . 24
Insert hooks for the Electronic Journal . . . . . . . . . . . . . . . 24
Link the terminal sales application . . . . . . . . . . . . . . . . . 25
Programming information for GSA . . . . . . . . . . . . . . . . . 26
Supermarket Application . . . . . . . . . . . . . . . . . . . . . 27
Insert hooks for the Electronic Journal . . . . . . . . . . . . . . . 27
| Insert hooks for the Enhanced LAN Feature or for MCF without ELF . . . . 28
Link the terminal sales application . . . . . . . . . . . . . . . . . 30
Chain Drug Sales Application . . . . . . . . . . . . . . . . . . . 33
Programming information for Chain Drug Sales . . . . . . . . . . . . 33

Appendix. QXLELFSV background status messages . . . . . . . . . . 63

iii
iv Electronic Journal User’s Guide
Notices
References in this publication to IBM products, programs, or services do not imply
that IBM intends to make these available in all countries in which IBM operates. Any
reference to an IBM product, program, or service is not intended to state or imply
that only IBM’s product, program, or service may be used. Any functionally
equivalent product, program, or service that does not infringe any of IBM’s
intellectual property rights may be used instead of the IBM product, program, or
service. Evaluation and verification of operation in conjunction with other products,
except those expressly designated by IBM, are the user’s responsibility.

IBM may have patents or pending patent applications covering subject matter in this
document. The furnishing of this document does not give you any license to these
patents. You can send license inquiries, in writing, to the IBM Director of Licensing,
IBM Corporation, North Castle Drive, Armonk, NY 10504-1785, U.S.A.

Trademarks
The following terms are trademarks of IBM Corporation in the United States or other
countries or both:
IBM

Other company, product, and service names, which may be denoted by a double
asterisk (**), may be trademarks or service marks of others.

v
vi Electronic Journal User’s Guide
Chapter 1. IBM Electronic Journal for 4690 OS—overview
This chapter describes the application features, functions, sizing information, offline
operations, system requirements, and installation.

Application features
| The IBM 4690 Electronic Journal for 4690 OS (5697-G45) 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:


| v Electronic journal log file for LAN environment reduces processing overhead and
| uses 4690 OS data spooling and despooling for offline processing.
v Electronic data journal to reduce or eliminate paper journal roll usage by the
store.
v Electronic data journal to reduce print head wear on the register printer.
v Paper journal prints automatically when the register is offline to the store
controller.
v Electronic data journal capture selected by register:
– Electronic Journal only
– Paper Journal only
– Both Electronic and Paper Journals
v Journal file content is identical to a printed paper journal roll.

| What’s new in Version 2?


| Version 2 of the IBM Electronic Journal for 4690 OS has these new features:
| v The Enhanced LAN feature (ELF)
| In a LAN environment, the Electronic Journal uses the full capabilities of the
| 4690 Operating System to recover from a File Server unavailable condition.
| Previously, the Electronic Journal wrote directly to the Electronic Journal data
| base. When the terminal was offline, the Electronic Journal had to control the
| writing of Electronic Journal data to the local controller. When the terminal came
| back online, the Electronic Journal also had to control retrieving and sending
| Journal data to the File Server. This extra work made the Electronic Journal
| application larger and more complex than necessary.
| With the Enhanced LAN Feature, the terminal writes to a journal log file, that is
| similar to a transaction log file. A background program (QXLELFSV), similar to
| Sales Support, reads this file and updates individual journal and index files for
| each terminal. If the File Server is unavailable, the Operating System
| automatically spools and despools as needed, reducing Electronic Journal code
| size and complexity.
| While designed around the LAN environment, you do not have to have the
| Multiple Controller Feature (MCF) installed to take advantage of this
| enhancement.
| v Journal file compression
| You can compress journal files after a certain number of days you specify.
| Optionally, you can compress the host poll file, QXLTRANS. The system does
| this by compressing the individual journal files before bundling them into
| QXLTRANS.

1
| v Schedule host file daily build
| You can define the schedule for building and compressing the QXLTRANS file.
| You can also specify the time that you want end-of-day tasks to run. You can
| schedule electronic journal end-of-day tasks to minimize interference with other
| end-of-day tasks.
|
Application functions
The IBM 4690 Electronic Journal application provides an electronic journal function
for the register sales application. With the electronic journal function enabled,
instead of printing on the register journal roll, the application captures journal data
at the register and saves it in a store controller file that is unique for that register for
that day. Electronic journal data is immediately available for the review function of
the Electronic Journal once the transaction completes. Journal data is separate
from Transaction Log data maintained by the system.

To review an electronic journal file, select it by date and register number. The
selected journal file can be reviewed in full using a scrolling capability that lets you
move swiftly through the file or, you can use a string search to locate specific items
of interest.

| Electronic Journal functions include:


| v The Electronic Journal Enhanced LAN Feature (EJELF, which is also referred to
| as ELF)
| v Tailoring options
| v Personalization options in the application
| v IBM EJ File Utility

| The Electronic Journal Enhanced LAN Feature changes the specific instance of
| how the Electronic Journal spools journal data when the file server is unavailable.
| Without it, the Electronic Journal spools data to the local store controller when a
| register cannot write directly to the Electronic Journal database on the file server.
| When the register is once more online to the file server, the Electronic Journal has
| responsibility for retrieving the data it wrote to the local store controller and writing
| the data to the proper file on the file server.

| The Electronic Journal without ELF is a larger and more processing-intensive


| function than the Electronic Journal with ELF.

| With ELF, a register writes to a Journal Log file that functions much like the
| Transaction Log (TLog) file. An associated background application (QXLELFSV)
| reads the Journal Log data and updates appropriate Electronic Journal files for
| each individual register just as the Checkout Support background application reads
| TLog data and updates accounting files. If the file server is momentarily
| unavailable, the 4690 Operating System (4690 OS) automatically spools the data to
| the local store controller and despools it from the local store controller to the file
| server when it becomes available again. This reduces processing that the Electronic
| Journal application must perform and uses the already existing capabilities of 4690
| OS.

Personalizing registers to use the Electronic Journal uses both Store options
and Terminal options. Store options control where journal data files reside on disk
and how long they stay there. The number of days worth of information kept in
electronic data journal files is a user-specified parameter although there are
practical limitations related to store controller disk drive size. The POS application

2 Electronic Journal User’s Guide


being used provides the ability to compress journal files, which then require less
storage space. You can specify when the POS application automatically triggers
journal compression. When retrieving a compressed journal for review, an
application decompresses it temporarily to display it.

Terminal options relate journal options to individual registers. You can specify
default terminal options that apply to all registers unless overridden for an individual
register. These options are described in “Chapter 2. IBM 4690 Electronic
Journal—personalization options” on page 7.

Tailoring the Electronic Journal for your store occurs by responding to a series of
questions that the Electronic Journal displays on tailoring panels. Point-of-sale
(POS) registers are further personalized for electronic journal functions through a
series of panels for both store options and terminal options.

| The first tailoring options select one of four possible environments, which are
| whether the Electronic Journal is being used over a LAN (LAN or no LAN) and
| whether the Enhanced LAN Feature is being used (ELF or no ELF). Further options
| tailor each resulting environment. These options are described in “Chapter 3. IBM
| Electronic Journal for 4690 OS—tailoring options” on page 11.

| The Electronic Journal File Utility, QXLT4690, lets you combine a number of files
| into one file for transmission to a host system. You can compress the individual files
| before combining them to form the output file, thereby reducing the number of
| characters to be transmitted.

| You can initiate collecting individual journal files into a single file in one of three
| ways:
| v The automatic host file build on an Electronic Journal server can automatically
| initiate this function at a time of day you specify in personalization. This option is
| described in “Chapter 2. IBM 4690 Electronic Journal—personalization options”
| on page 7.
| v A user program can initiate this function, for example as part of a store closing
| or end-of-day processing routine.
| v The QXLT4690 command can be executed from the command line or as part of
| a BAT file. Examples of using the command appear in “Chapter 5. IBM Electronic
| Journal for 4690 OS file utility” on page 21.
|
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 an average (or peak) day
for a specific register is:
Feet of journal roll used during the day X 72 (lines per foot) X 40 (bytes per line)

This calculation estimates the number of bytes of data to be stored. Multiplying the
result by the number of registers in the store gives the bytes needed per day for
Electronic Journal files.

Chapter 1. IBM Electronic Journal for 4690 OS—overview 3


Offline operations
| Offline has different definitions depending on whether a store has a single controller
| or uses the 4690 OS Multiple Controller Feature (MCF). Another factor for MCF
| offline operations is whether the store is using the Enhanced LAN Feature (ELF).
| Another factor influencing how the Electronic Journal operates while offline is
| whether the store uses 4610 printers at all registers. Each of these scenarios is
| described below.

In a single controller environment, offline means that the register is not


communicating with the controller.

The rest of this description is about the multiple controller environment. In a


multiple controller environment, it is possible for a register to be offline to the File
Server, but still be online either to the Alternate File Server or to another controller
on the LAN. In these cases, although it is not possible to update Electronic Journal
master files, which reside on the File Server, the Electronic Journal can spool
temporary data to the local store controller that is later despooled to the master
files when the File Server comes online.

| Without ELF, if a register is offline to the File Server and the Electronic Journal, the
| Electronic Journal background application, QXLSERVE, is responsible for spooling
| journal data to the local store controller. When the local store controller regains
| access to the File Server (or becomes the File Server), QXLSERVE is responsible
| for despooling local electronic journal transactions into appropriate electronic journal
| files on the File Server.

| With ELF, a different Electronic Journal background application, QXLELFSV, uses


| 4690 OS to spool and despool data to an Electronic Journal Log file. Another
| background application reads the log and distributes the data to the appropriate
| master Electronic Journal data files. When offline, 4690 OS spools the data to a
| temporary log file on the local controller. When the File Server comes online, 4690
| OS despools the temporary data to the log file on the File Server, where the
| background application can distribute data from the log to the proper files.

| The application can record journal data in IBM 4610 printer memory when a
| register is offline to all controllers. The 4610 memory holds the journal information
| until the register is back online. When the register returns to online status,
| transactions in printer memory are sent to the controller at the time specified in the
| C:\EJ\QXLUTIME.DAT file, if present.

| If the C:\EJ\QXLUTIME.DAT file is not present, transactions stored in the printer


| memory are sent to the store controller using Trickle Transmit upon returning to
| online status. Trickle Transmit sends individual transactions retrieved from the
| printer memory to the controller as the opportunity presents itself during normal
| register activities. At the end of each current transaction, Trickle Transmit retrieves
| two stored transactions from printer memory and sends them to the controller.
| Additionally, if the register detects what is considered to be an idle state, Trickle
| Transmit periodically retrieves two transactions from printer memory and sends
| them to the controller.

| Note: If you have been using QXLUTIME to control unloading stored transactions
| from printer memory and now wish to use the Trickle Transmit feature
| instead, you must delete the QXLUTIME file from your system. Trickle
| Transmit does not function correctly if the QXLUTIME file is present.

4 Electronic Journal User’s Guide


| When present, QXLUTIME.DAT should contain the time when you want data sent
| from printer memory to the controller. Specifying a time when the store is not busy
| minimizes the processing delay at the register that the data transmission causes.

| Specify the time in QXLUTIME.DAT in the format HHMM, where HH is the hour
| from 0 - 23, and MM is the minutes from 0 - 59. If this file exists and the data is
| null, the transmission time defaults to 0000, which is midnight.

| You can create QXLUTIME.DAT using an ASCII editor such as DREDIX, which is
| available on the 4690 controller. In an MCF environment, you must cause the file to
| be distributed by selecting distribution type 3 in the 4690 Distributed File Utilities. If
| the file is not distributed and the master file server is offline, the register receives an
| error when attempting to open the file. When this happens, the Electronic Journal
| cannot read whatever time is in the file, which causes it to default to immediate
| transmission of the data.

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
offline 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 offline 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 is not printed on the register journal roll
because as far as the register is concerned, it is online at the critical time.

System requirements
| The IBM Electronic Journal for 4690 OS executes on both 4680 and 4690 hardware
| platforms.

Operating Systems:
| v IBM 4680 OS, Version 2 5601-192
| v IBM 4680 OS, Version 4 5696-039
v IBM 4690 OS, Version 1 5696-538
| v IBM 4690 OS, Version 2 5639-F53
Applications:
v IBM 4680 Chain Sales Application 5669-212
v IBM 4680 Supermarket Application 5669-032
v IBM 4680 General Sales Application 5669-031
v IBM 4680 Specialty Sales Application 5799-CRC
v IBM 4680-4690 Supermarket Application 5696-536
v 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. Be sure to check the installation log for any error
messages and resolve any errors logged.

When you have completed this successfully, follow the instructions in “Chapter 6.
IBM Electronic Journal for 4690 OS integration” on page 23 to incorporate the
required code changes into your POS terminal application.

Chapter 1. IBM Electronic Journal for 4690 OS—overview 5


6 Electronic Journal User’s Guide
Chapter 2. IBM 4690 Electronic Journal—personalization
options
| The IBM Electronic Journal for 4690 OS lets you customize the operation of your
| system. You can provide option information either in a file down-loaded from a host
| system, or through personalization panels in the store.

Personalization options are divided into store options and terminal options. Store
options specify information about journal files. Terminal options specify information
about registers and the type of journals desired. The application uses default
settings if you do not update the options file. Terminal options for register 000
provide defaults for all store registers. Choosing a specific register number
overrides default settings for that particular terminal only.

| 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.
|
QXLSCREN30 ELECTRONIC JOURNAL PERSONALIZATION

Select one of the following: 1

1. Terminal Options
2. Host File Build
3. End of Day

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

Figure 1. Personalization panel

| The following sections describe each option:


v “Terminal options” on page 8
v “Host file build” on page 9
v “End of day” on page 10

After changing options on any panel, press Enter to update the Options file. You
must reload the terminal after changing personalization options to put them into
effect, or wait until the system reloads all terminal options at the beginning of a new
day (usually midnight).

To reload terminal options immediately:


1. Stop and restart the background application QXLSERVE.
2. Reload the terminal application.

7
Terminal options
| If you pick Terminal Options from the Personalization panel, additional information
| appears on the panel as shown in boldface font in Figure 2.
|
QXLSCREN34 ELECTRONIC JOURNAL PERSONALIZATION

Select one of the following: 1

1. Terminal Options
2. Host File Build
3. End of Day

Enter the desired terminal number: 000


(1-999 or 000 for default)

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

Figure 2. Personalization panel after selecting Terminal Options

| When you select a terminal number and press Enter, the panel shown in Figure 3
| appears.
|
QXLSCREN31 ELECTRONIC JOURNAL TERMINAL OPTIONS

Type the following information for terminal 000

Type of Journal for this terminal ==> 2


1 Electronic Only
2 Paper Only
3 Both Paper & Electronic

Number of days to save ==> 33

Number of days before compress ==> 11

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

Figure 3. Terminal options panel

| You supply requested information for each field as described below:


| Type of Journal for this terminal
| You have three options for normal journal entries:

8 Electronic Journal User’s Guide


| 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 and Electronic means the register provides a printed copy
| and an electronic copy of the journal information.
| Number of days to save
| This parameter defines the number of days that the system keeps electronic
| journal files and reports. The maximum value is 366 days, which is 1 year of
| data. Journal information and reports are automatically purged when the time
| elapses.
| Number of days before compress
| To save space, 4690 Electronic Journal automatically compresses journal files.
| This parameter is used to specify how many uncompressed days worth of data
| should be kept. The current day is always uncompressed. When data is
| compressed, it must be decompressed prior to displaying, which slows down
| any Electronic Journal function.

| Host file build


| If you pick Host File Build from the Personalization panel, the panel shown in
| Figure 4 appears.
|
QXLSCREN32 ELECTRONIC JOURNAL HOST FILE BUILD OPTIONS

Build host file QXLTRANS automatically? ==> Y (Y/N)

Build the QXLTRANS file every day at: ==> 12:34 (HH:MM)

Should QXLTRANS file be compressed? ==> N (Y/N)

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

Figure 4. Host file build options panel

| You supply requested information for each field as described below:


| Build host file
| You have two options:
| v N Do not build the QXLTRANS file automatically. You can still use the
| QXLT4690 File Utility to build the QXLTRANS file, but Electronic Journal will
| not run the utility automatically.
| v Y, which is the default. This causes the Electronic Journal to execute the
| QXLT4690 File Utility automatically every day at the same time. It executes
| for the previous calendar day. It runs once and only once for every day. If
| for some reason, the QXLT4690 File Utility has not run yet on a particular
| day, the Electronic Journal detects it and runs QXLT4690 as soon as
| possible for that day.

Chapter 2. IBM 4690 Electronic Journal—personalization options 9


| Build the QXLTRANS file every day at:
| Enter HH:MM to specify the time of day when you want the QXLT4690 utility to
| run.
| Should QXLTRANS file be compressed?
| You have two options:
| v N The journal file will not be compressed before transmission to the host.
| v Y The journal file will be compressed. This will reduce transmission type and
| disk storage requirements.
|
| End of day
| If you pick End of Day from the Personalization panel, the panel shown in Figure 5
| appears.
|
QXLSCREN33 ELECTRONIC JOURNAL EOD PERSONALIZATION

Select one of the following: 3

1. Terminal Options
2. Host File Build
3. End of Day

Type the time for journal


End of day routines to run. 02:00 (HH:MM)

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

Figure 5. EOD personalization panel

| End-of-day journal routines run automatically at the specified time. These routines:
| v Erase Journals when the retention period has expired
| v Compress Journals when it is time to do so
| If they do not not run for some reason, the Electronic Journal detects the condition
| and runs the end-of-day routines as soon as possible.

10 Electronic Journal User’s Guide


Chapter 3. IBM Electronic Journal for 4690 OS—tailoring
options
| The IBM 4690 Electronic Journal lets you tailor the operation of the system. You
| provide the option information through the tailoring panels.

Tailoring options lead you through the process of gathering information that is
important to the Electronic Journal. Tailoring allows the Electronic Journal
application to interface with a wide variety of environments.

| On the command line of the 4690 operating system, type QXLTAYLR and press
| Enter. The TAILOR ELECTRONIC JOURNAL FEATURE panel appears. F3 is used
| to exit the process.

ELF and MCF

QXLSCREN50 TAILOR ELECTRONIC JOURNAL FEATURE

Type the following information:

Journal Session Number ==> 99

Do you use ELF? ==> Y Do you use MCF? ==> N

Do you use 4610 Printer? ==> Y

Do you use Medium Model in your Terminal Sales Application? ==> N

Maximum Number of lines per Transaction ==> 666

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

Figure 6. Tailor Electronic Journal Feature panel

You supply the requested information for each of the fields.

| Tailoring parameters and default values.


| Journal Session Number
| This parameter represents the session ID number for use by the application
| when referring to the electronic journal data file. Assign a number that does not
| conflict with application session numbers.
| Do you use ELF?
| Default = Y. It is recommended that the store use ELF because it is a less
| complex software package that requires fewer system processing resources.
| MCF is recommended for using ELF, but is not necessary.
| Do you use MCF?
| Default = N. If the store uses the 4690 operating system Multiple Controller

11
| Feature, the correct response is Y. This is information that the application uses
| to identify the execution environment and available resources for offline
| conditions.

| Note: This option does not appear if the Do you use ELF? option is Yes.
| Do you use 4610 Printer?
| Default = Y. If all registers have the IBM 4610 printer attached, the correct
| response is Y. In offline conditions, the memory in the 4610 printer is used
| instead of a printed copy of the journal data. Use N if any registers have older
| IBM Model 1 through Model 4 printers attached.
| Do you use Medium Model in your Terminal Sales Application?
| Default = N. This information is used to suggest the appropriate modules to be
| linked together for the terminal sales application with electronic journal.

| Note: It is recommended that you use the Big Memory Model in your POS
| application when doing electronic journaling. Using the Medium Model
| might not provide enough memory in your application data space.
| Maximum Number of lines per Transaction
| Default = 0, which implies no limit. Setting a maximum number of lines to occur
| in any electronic journal transaction allows the program to request the largest
| block of memory that it needs during the day. This is particularly 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 in the
| journal file.

| When the Do you use ELF? field is Y on the first tailoring panel, the panel shown in
| Figure 7 appears:
|
QXLSCREN52 TAILOR ELECTRONIC JOURNAL: ENHANCED LAN FEATURE (ELF)

Type the following information to be used by BACKGROUND processing:

Days to keep log ==> 5

Seconds to wait at EOF ==> 10

Minutes to wait at EODAY==> 15

When complete, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

Figure 7. Tailor Electronic Journal: Enhanced LAN Feature (ELF) panel

| You supply the requested information for each of the fields.

| Tailoring parameters and default values.

12 Electronic Journal User’s Guide


| Days to keep log
| This is the Journal Log file, which is similar to the Transaction Log file. It is a
| file for storing Electronic Journal data temporarily before the background
| application separates it into individual register files. You must define how long to
| keep this Journal Log.
| Seconds to wait at EOF
| As data is written to the Journal Log file, a background task periodically parcels
| out the data to individual register files. When there is no more data to process,
| this option specifies the delay in seconds before the background application
| processes the Journal Log.
| Minutes to wait at EODay
| Because of the possibility that some registers cannot send all their Electronic
| Journal data by the start of end-of-day processing, the system waits the number
| of minutes specified in this option for data transmission to complete for the old
| Journal Log file before beginning a new Journal Log file. A value of 0 causes
| the system to wait indefinitely.

| You can review selected options before saving them. Error messages point out any
| setting conflicts. To resolve errors or change a value, press F3 to return to the
| previous panel.

| When the Do you use ELF? field is Y on the first TAILOR ELECTRONIC
| JOURNAL FEATURE panel, and all other data entry is complete, a summary panel
| appears that is similar to that shown in Figure 8:
|
QXLSCREN53 TAILOR ELECTRONIC JOURNAL FEATURE WITH ELF

Based on your selections use the following L86 file to link


your terminal sales application: ???XJPLB , where ???=EAM for SA
EAL for GSA
EGH for CSA
You selected the following options:

ELF in use ==> Y Medium Memory Model ==> N

4610 Printer ==> Y Max lines per XTN ==> 666

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

Journal Session ==> 99

To save these options, press ENTER.

F1 F2 F3 QUIT F4 F5
F6 F7 F8 F9 F10

Figure 8. Tailor Electronic Journal Feature with ELF summary panel

| You can review selected options before saving them. Error messages point out any
setting conflicts. To resolve errors or change a value, press F3 to return to the
previous panel.

Press Enter to save all option settings.

Chapter 3. IBM Electronic Journal for 4690 OS—tailoring options 13


| No ELF and no MCF
|
QXLSCREN50 TAILOR ELECTRONIC JOURNAL FEATURE

Type the following information:

Journal Session Number ==> 99

Do you use ELF? ==> N Do you use MCF? ==> N

Do you use 4610 Printer? ==> Y

Do you use Medium Model in your Terminal Sales Application? ==> Y

Maximum Number of lines per Transaction ==> 800

When complete, press ENTER.

Figure 9. Tailor Electronic Journal Feature panel

| When Do you use ELF? = N and Do you use MCF? = N and all other data is
| entered, a summary panel similar to that shown in Figure 10 appears:
| Error messages point out any setting conflicts. F3 lets you change settings. Press
QXLSCREN54 TAILOR ELECTRONIC JOURNAL FEATURE - NO ELF

Based on your selections use the following L86 file to link


your terminal sales application: ???EJPNB , where ???= EAM for SA
EAL for GSA
EGH for CSA
These are the options you have selected:

MCF in use ==> N Pipe ID ==>

4610 Printer ==> Y Max lines per XTN ==> 800

Medium Model ==> Y

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

Journal Session ==> 99

Control Session ==> 0 Spool Session ==> 0 Despool Session ==> 0

To save these options, press ENTER.

Figure 10. Tailor Electronic Journal Feature—No ELF summary panel

| Enter to save all options settings.

14 Electronic Journal User’s Guide


MCF and No ELF

QXLSCREN50 TAILOR ELECTRONIC JOURNAL FEATURE

Type the following information:

Journal Session Number ==> 99

Do you use ELF? ==> N Do you use MCF? ==> Y

Do you use 4610 Printer? ==> Y

Do you use Medium Model in your Terminal Sales Application? ==> Y

Maximum Number of lines per Transaction ==> 800

When complete, press ENTER.

Figure 11. Tailor Electronic Journal Feature panel

| When Do you use ELF? = N, Do you use MCF? = Y and all other data is entered, a
| panel similar to that shown in Figure 12 appears:
|
QXLSCREN51 TAILOR ELECTRONIC JOURNAL FEATURE - NO ELF

Specify an available Pipe ID ==> F

When a terminal is offline 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

Figure 12. Tailor Electronic Journal Feature—No ELF panel

| You supply the requested information for each field.


Available Pipe ID
If MCF = Y, you must supply a unique Pipe ID for the data pipe between the
register and the controller.
Terminal Offline Option
Default = 1. Option 1 means that the terminal is considered completely offline

Chapter 3. IBM Electronic Journal for 4690 OS—tailoring options 15


from all store controllers. This option forces printing of the journal if a journal
printer station is available, or uses memory in a IBM 4610 printer, if the option
was selected previously.

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, which means that no local controller is available for offline spooling.
If a local controller is available, assign a unique session number for the Control
File.
Spool Session
Default = 0, which means that no local controller is for offline spooling. If a local
controller is available, assign a unique session number for the spool process.
DeSpool Session
Default = 0, which means that no local controller is for offline spooling. If a local
controller is available, assign a unique session number for the despool process.

If a register is offline to all controllers, the journal for the offline transactions is
written on the paper journal unless the printer is an IBM 4610 printer.

| After pressing Enter, a panel similar to that shown in Figure 13 appears:


|
QXLSCREN54 TAILOR ELECTRONIC JOURNAL FEATURE - NO ELF

Based on your selections use the following L86 file to link


your terminal sales application: ???EJPLB , where ???= EAM for SA
EAL for GSA
EGH for CSA
These are the options you have selected:

MCF in use ==> Y Pipe ID ==> F

4610 Printer? ==> Y Max lines per XTN ==> 800

Medium Model ==> N

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

Journal Session ==> 99

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

To save these options, press ENTER.

Figure 13. Tailor Electronic Journal Feature—No ELF summary panel

| You can review the selected options. If there is a conflict with any of the choices, an
error message is displayed. From the error message panel, you return to the first
panel in the process.

16 Electronic Journal User’s Guide


Chapter 4. IBM Electronic Journal for 4690 OS—Journal
review
| The electronic journal function of the IBM Electronic Journal for 4690 OS captures
| the journal information in the register application at the point where the data
| normally prints. 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

QXLSCREN20 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

Figure 14. Process single journal panel

If you know which journal they need to review, they can directly select the journal
by supplying the date and the register number.

If you do not know which register journals are available, selections 3 and 4 provide
this information either by register number or activity date.

You can select either to display the journal or to print a copy on the store controller
printer. If you elect to display the journal, a function key on the displayed report lets
you print a copy after review.

The information panels are shown next.

17
Journal list by date

JOURNAL LIST, BY DATE Page 1

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


04/27 001
002
04/28 001
002
003
004
05/01 001
003
005
006
05/02 001

F1 F2 F3 QUIT F4 PRINT F5 DISPLAY


F6 F7 F8 F9 F10

Figure 15. Journal list by date panel

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
05/03
002 04/28
05/01
003 05/01
05/02
05/03
005 05/04

F1 F2 F3 QUIT F4 PRINT F5 DISPLAY


F6 F7 F8 F9 F10

Figure 16. Journal list by register panel

Journal display panel

18 Electronic Journal User’s Guide


$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

Figure 17. Journal display panel

Note: In the above panel, $JJ:428095 is the ID of the journal being displayed.

Once you select the individual journal for review, the Electronic Journal reads the
journal information and formats the report for display. The following keys 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 you press F4 while the report is displayed, a copy of the entire journal is sent to
the store controller printer.

If you press F10 to initiate a search, the Basic Journal String Search panel is
displayed.

Chapter 4. IBM Electronic Journal for 4690 OS—Journal review 19


$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

Figure 18. Basic journal string search panel

The % read indicator in the upper right hand 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.

You 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. Press Enter 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 paging through the entire journal.

If the matching condition is not found, END OF FILE REACHED WITHOUT FINDING MATCH
| is displayed.

20 Electronic Journal User’s Guide


|
| Chapter 5. IBM Electronic Journal for 4690 OS file utility
| The QXLT4690 File Utility lets you combine a number of files into a single file for
| transmission to a host system. You can compress the individual files before
| combining them to form the output file, thereby reducing the number of characters
| to be transmitted.
|
| QXLT4690 syntax
| To run QXLT4690 from the 4690 controller at the command prompt, type:
| QXLT4690 -i inputfile -o outputfile -c -v -s nnnn
| inputfile
| Optional parameter that is the file specification for files to be compressed,
| without the assumed EJJ: prefix.
| outputfile
| Optional parameter that is the fully-qualified file specification of the resulting
| combined file. The default file path is the directory where the command is being
| issued.
| —c
| Optional parameter that turns on compression.
| —v
| Optional parameter for verbose mode, where each step is displayed as it is
| done.
| —s nnnn
| Optional parameter that causes nnnn to be used as the store number instead of
| the Store Number specified in the 4690 OS Controller Characteristics
| Configuration.
|
| Examples of using QXLT4690
| You could issue the commands in the following examples from the command line,
| from a BAT file, or in a user-written program.
| "QXLT4690 -i 805*.* -o jt805.dat"

| Combines all files in the path EJJ:805*.* to form the single file jt805.dat. It does not
| perform compression and does not list files as it adds them to the single file.
| "QXLT4690 -i *.* -o jt805.dat -c -v"
|

| Compresses all files in the path EJJ:805*.* to form the single file jt805.dat. It lists
| each file on the display as it compresses and adds the file to the single file.

21
22 Electronic Journal User’s Guide
Chapter 6. IBM Electronic Journal for 4690 OS integration
IBM 4680/4690 Terminal Applications Overview The IBM 4690 Electronic Journal
Feature must be integrated into your POS terminal application. At 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, changes to the source are required.

Once you have changed and recompiled the appropriate terminal sales application
modules you must relink 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.

Electronic Journal Feature user exits


The Electronic Journal Feature provides user exits QXLEXIT1 and QXLEXIT2.

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

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 to not 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

23
General Sales Application

Insert hooks for the Electronic Journal


A directory named EAL located on one of the Integration diskettes contains the
following GSA User Exit modules:
v EALTSU06.BAS
v EALTSU15.BAS
v 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.

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$)
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 CHECK.OFFLINE EXTERNAL


| FEND

FUNCTION CheckJournalFile EXTERNAL


FEND

FUNCTION TRAN.TO.EXIT PUBLIC


INTEGER*2 TRAN.TO.EXIT ! Define function type

24 Electronic Journal User’s Guide


CALL CheckJournalFile !
CALL CHECK.OFFLINE

FEND
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
END FUNCTION

Link the terminal sales application


Once you have recompiled EALTSU06, EALTSU15, and EALTSU16, relink 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
tells 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 depending on memory model and the features that are being
used.

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
significantly reduce the size of the electronic journal code by linking with
EALEJNNM.L86. In that same environment you can also link with
EALEJPLM.L86. The function is identical, but more code space is used.

| The L86 files are:


|| Memory Model File Name Electronic Journal Features
| Medium EALEJNNM No features
| Medium EALEJPNM 4610 Printer Support only
| Medium EALEJNLM Spooling in LAN Environment only
| Medium EALEJPLM 4610 Printer, LAN Environment
| Medium EALXJPLM Enhanced LAN Feature with or without 4610
| Printer support
| Big EALEJNNB No features
| Big EALEJPNB 4610 Printer Support only

Chapter 6. IBM Electronic Journal for 4690 OS integration 25


| Memory Model File Name Electronic Journal Features
| Big EALEJNLB Spooling in LAN Environment only
| Big EALEJPLB 4610 Printer, LAN Environment
| Big EALXJPLB Enhanced LAN Feature with or without 4610
| Printer support
|

| Programming information for GSA


The IBM 4690 Electronic Journal intercepts all writes to the journal that passes
through PRINT.EXIT$ . If in any of your user exit code you write directly to the
journal, the Electronic Journal is not 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"+RIGHT$("0"+STR$(ADVANCE%,2)
| WRITE FORM FORMAT$ ; #23 ; Print.line$
| ENDIF
|

26 Electronic Journal User’s Guide


Supermarket Application

Insert hooks for the Electronic Journal


A directory named EAM on one of the Integration diskettes contains the following
User Exit modules:
v EAMTSUSU.J86
v EAMTSU01.J86
v EAMTSU02.J86
v EAMTSU04.J86
v EAMTSU05.J86
v EAMTSU07.J86
v EAMTSU14.J86
v EAMTSU18.J86
v EAMTSU54.J86

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

Note: You must pass a session number when calling User Exit 7. 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.

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 = 89 ! Session Number to use for personalization


FEND

FUNCTION QXL.TSUPEC07 EXTERNAL


FEND

FUNCTION QXL.TSUPEC14 EXTERNAL


FEND

FUNCTION QXL.TSUPEC18 EXTERNAL


FEND

Chapter 6. IBM Electronic Journal for 4690 OS integration 27


FUNCTION QXL.TSUPEC54 EXTERNAL
FEND

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
9. In module EAMTSU54.J86, insert the code:
CALL QXL.TSUPEC54

| Note: You must also add one set of code described in “Insert hooks for the
| Enhanced LAN Feature or for MCF without ELF” to your version of the user
| exits, depending on whether you use the Enhanced LAN feature.

| Insert hooks for the Enhanced LAN Feature or for MCF without ELF
| Insert hooks for the Enhanced LAN Feature
| To use the Enhanced LAN Feature of the Electronic Journal, you must add the user
| exit code described in this section. A directory named EAM on one of the
| Integration diskettes contains the following User Exit modules:
| v EAMTSUSU.J86
| v EAMTSU21.J86
| v EAMTSU53.J86

| You can copy these files into your development directory. Either use these J86 files
| to compile EAMTSUPC, or integrate the contents of these J86 files into your
| versions of these user exits.

| 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.TSUPEC21(PRTLINE) EXTERNAL
| STRING QXL.TSUPEC21, PRTLINE
| FEND
|
| FUNCTION QXL.TSUPEC53 EXTERNAL
| FEND
|
| 2. In module EAMTSU21.J86, insert the code:
| STRING PRTLINE
| INTEGER*1 TRAINING.EXIT
| INTEGER*2 I

28 Electronic Journal User’s Guide


|
|
| IF TS.LINETYPE = 25 THEN BEGIN ! START OF EXIT TRAINING ?
| IF NOT TRAINING.EXIT THEN BEGIIN ! YES...
| CALL QXL.TSUPEC01
| TRAINING.EXIT = -1
| ENDIF
| ENDIF
|
| PRTLINE = TS.PRTBUF$ ! Pass the current line
|
|
| I = MATCH(CHR$(27)+CHR$(69),PRTLINE,1)
| IF I <> 0 THEN BEGIN
| PRTLINE = LEFT$(PRTLINE,I-1) + RIGHT$(PRTLINE,LEN(PRTLINE)-I-1)
| ENDIF
|
| PRTLINE = TS.PRTBUF$ !Pass the current line
| PRTLINE = QXL.TSUPEC21(PRTLINE) ! to EJ. If EJ
| IF PRTLINE = "" THEN BEGIN ! returns a null, then
| TS.SJDTAT$ = STRING$(LEN(TS.SJDATA$)," ") ! don't print this line
| TS.PRTBUF$ = STRING$(LEN(TS.PRTBUF$)," ") ! on the paper journal
| ENDIF
|
| IF TS.LINETYPE = 23 THEN BEGIN ! END OF SIGNOFF TRANS
| CALL QXL.TSUPEC02
| TRAINING.EXIT = 0
| ENDIF
|

| The QXL.TSUPE21 function puts the information in the electronic journal, and
| determines whether the data needs to be printed on the physical journal. If the
| QXL.TSUPE21 function returns a null, then you need not print the data;
| otherwise, you do need to print it.
| 3. In module EAMTSU53.J86, insert the code:
| CALL QXL.TSUPEC53
|

| Insert hooks for MCF without the Enhanced LAN Feature


| To use MCF without the Enhanced LAN Feature, add the user exit code described
| in this section. A directory named EAM on one of the Integration diskettes contains
| the following User Exit modules:
| v EAMTSUSU.J86
| v EAMTSU21.J86

| You can copy these files into your development directory. Either use these J86 files
| to compile EAMTSUPC, or integrate the contents of these J86 files into your
| versions of these user exits.

| 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 JOURNAL(PRTLINE) EXTERNAL
| STRING JOURNAL,PRTLINE
| FEND
|
|
| 2. In module EAMTSU21.J86, insert the code:
| STRING PRTLINE
| INTEGER*1 TRAINING.EXIT
| INTEGER*2 I

Chapter 6. IBM Electronic Journal for 4690 OS integration 29


|
|
| IF TS.LINETYPE = 25 THEN \ ! START OF EXIT TRAINING ?
| IF NOT Training.Exit THEN BEGIN ! YES...
| CALL QXL.TSUPEC01
| TRAINING.EXIT = -1
| ENDIF
|
| PRTLINE = TS.PRTBUF$ ! Pass the current line
|
|
| I = MATCH(CHR$(27)+CHR$(71),PRTLINE,1)
| IF I <> 0 THEN BEGIN
| PRTLINE = LEFT$(PRTLINE,I-1) + RIGHT$(PRTLINE,LEN(PRTLINE)-I-1)
| ENDIF
|
| PRTLINE = JOURNAL(PRTLINE) ! to ESCAPE. If ESCAPE
| 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 !
|
| IF TS.LINETYPE = 23 THEN BEGIN !END OF SIGNOFF TRANS
| CALL QXL.TSUPEC02
| TRAINING.EXIT = 0
| 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 you need not print the data; otherwise,
| you do need to print it.

| Link the terminal sales application


Once EAMTSUPC is recompiled, relink the 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 tells 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 depending on the memory model and features being used.

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. If using ELF, also activate terminal user
| exit 53.

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
significantly reduce the size of the electronic journal code by linking with

30 Electronic Journal User’s Guide


EAMEJNNM.L86. In that same environment you can also link with
EAMEJPLM.L86. The function is identical, but more code space is used.

| The L86 files are:


|| Memory Model File Name Electronic Journal Features
| Medium EAMEJNNM No features
| Medium EAMEJPNM 4610 Printer Support only
| Medium EAMEJNLM Spooling in LAN Environment only
| Medium EAMEJPLM 4610 Printer, LAN Environment
| Medium EAMXJPLM Enhanced LAN Feature with or without 4610
| Printer support
| Big EAMEJNNB No features
| Big EAMEJPNB 4610 Printer Support only
| Big EAMEJNLB Spooling in LAN Environment only
| Big EAMEJPLB 4610 Printer, LAN Environment
| Big EAMXJPLB Enhanced LAN Feature with or without 4610
| Printer support
|

| Compile EAMTSUPC.

If using EAMTS10L.INP, copy EAMTSUPC.OBJ to EAMTSUPC.LBJ prior to


re-linking the terminal sales application.

Programming information for the 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 is not 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 appropriate function call.

| If using the Enhanced LAN Feature:


| !********************************************************
| ! Definition of Journaling Routine
| !*******************************************************
| FUNCTION TSUPEC21(PRINTLINE) EXTERNAL
| STRING QXL.TSUPEC21, PRTLINE
| FEND
| !*******************************************************
| !! 1. Call TSUPEC21, passing the 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 is returned,
| ! Otherwise, the line is printed directly to the journal.
| !******************************************************
| Print.line$ = QXL.TSUPEC21(Print.line$)
| IF LEN(Print.line$) <> 0 THEN BEGIN
| WRITE FORM "C38A1" ; #36 ; Print.line$
| ENDIF

| If using the MCF without the Enhanced LAN Feature:


| !*********************************************************
| ! Definition of Journaling Routine
| !*********************************************************

Chapter 6. IBM Electronic Journal for 4690 OS integration 31


| FUNCTION Journal(PrtLine) EXTERNAL
| STRING Journal, PrtLine
| FEND
|
| !*********************************************************
| ! 1. Call JOURNAL, passing the 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 is returned.
| ! Otherwise, the line is printed directly to the journal
| !***********************************************************
|
| PRINT.LINE$ = JOURNAL(PRINT.LINE$) EXTERNAL
| IF LEN(PRINT.LINE$) <> 0 THEN BEGIN
| WRITE FORM "c38A1" ; #36 ; PRINT.LINE$
| ENDIF

32 Electronic Journal User’s Guide


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 depending on the memory
model and features being used.

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
significantly reduce the size of the electronic journal code by linking with
EGHEJNNM.L86. In that same environment you can also link with
EGHEJPLM.L86. The function is identical, but more code space is used

| The L86 files are:


|| Memory Model File Name Electronic Journal Features
| Medium EGHEJNNM No features
| Medium EGHEJPNM 4610 Printer Support only
| Medium EGHEJNLM Spooling in LAN Environment only
| Medium EGHEJPLM 4610 Printer, LAN Environment
| Medium EGHXJPLM Enhanced LAN Feature with or without 4610
| Printer support
| Big EGHEJNNB No features
| Big EGHEJPNB 4610 Printer Support only
| Big EGHEJNLB Spooling in LAN Environment only
| Big EGHEJPLB 4610 Printer, LAN Environment
| Big EGHXJPLB Enhanced LAN Feature with or without 4610
| Printer support
|

| Programming information for Chain Drug Sales


Some changes need to be made to the following terminal source code modules:
v EGHTCKOT
v EGHTLWAY
v EGHTMAIN
v EGHTRCAL
v EGHTSUBB

Chapter 6. IBM Electronic Journal for 4690 OS integration 33


In addition, all direct writes to the summary journal need to be replaced by a call to
the Journal routine. The Journal FUNCTION returns a string; the string either is
NULL, or it is identical to the input string. If the Journal returns a null, do not print
this line on the summary journal; otherwise, 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

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$

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

34 Electronic Journal User’s Guide


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

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


!! GL.DISPLINE$ = " " + ?FORMAT.AMOUNT$(GL.BALDUE) !IR73494
!! CALL DISPLAY (2,5,16) !IR73494
!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

\!AIR85937
REM*********************************************
REM display foreign currency amount due
REM

Chapter 6. IBM Electronic Journal for 4690 OS integration 35


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 customer
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 pressed
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
!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

36 Electronic Journal User’s Guide


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

!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)

Chapter 6. IBM Electronic Journal for 4690 OS integration 37


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 !
!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

38 Electronic Journal User’s Guide


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
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

Chapter 6. IBM Electronic Journal for 4690 OS integration 39


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

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

40 Electronic Journal User’s Guide


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

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

Chapter 6. IBM Electronic Journal for 4690 OS integration 41


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 !
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" + \

42 Electronic Journal User’s Guide


?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) !

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 !
\!EIR8593
IF GL.TENDDUE < 0 THEN \ food stamp tax adjustment
GL.CHANGE = GL.CHANGE + \ add food stamp tax
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

Chapter 6. IBM Electronic Journal for 4690 OS integration 43


!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

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

44 Electronic Journal User’s Guide


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

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
IF GL.NEGBALDUE = GL.ON THEN \ if bal due negative
GL.AMTPROMPT$ = LEFT$(GL.AMTPROMPT$,15) + - !
RETURN

Chapter 6. IBM Electronic Journal for 4690 OS integration 45


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

Code 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
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 :\

46 Electronic Journal User’s Guide


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

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) + \

Chapter 6. IBM Electronic Journal for 4690 OS integration 47


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
NEXT I !

END SUB

Code 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
!***************************************************************

Code 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

48 Electronic Journal User’s Guide


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

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) + \
" " + \

Chapter 6. IBM Electronic Journal for 4690 OS integration 49


?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
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 !

50 Electronic Journal User’s Guide


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

Code 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
!****************************************************************

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

Chapter 6. IBM Electronic Journal for 4690 OS integration 51


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

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 \

52 Electronic Journal User’s Guide


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
!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

Chapter 6. IBM Electronic Journal for 4690 OS integration 53


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

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$ \

54 Electronic Journal User’s Guide


+" "+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

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

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

Chapter 6. IBM Electronic Journal for 4690 OS integration 55


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.


! 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

56 Electronic Journal User’s Guide


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 !CIR90
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 !

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

Chapter 6. IBM Electronic Journal for 4690 OS integration 57


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

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

58 Electronic Journal User’s Guide


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

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$) !

Chapter 6. IBM Electronic Journal for 4690 OS integration 59


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
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

60 Electronic Journal User’s Guide


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

Chapter 6. IBM Electronic Journal for 4690 OS integration 61


62 Electronic Journal User’s Guide
Appendix. QXLELFSV background status messages
31 Initializing... 93 Can’t open ELFCHKPT....STOPPING.
Severity: Informational Severity: Severe
Explanation: The application has just been started Explanation: The Check point file exists; however, an
and is initializing. error occurred when QXLELFSV issued an open to the
file.
User Response: N/A
User Response: Call Headquarters.
Programmer Response: N/A
Programmer Response: Examine EDJ error logs
(EDJLOGn, where n=1-7) to see if you can determine
33 Erasing old files
cause of error. If not, send copies of error logs to IBM.
Severity: Informational
Explanation: QXLELFSV is starting the QXLEODAY 94 New date is->yyyymmdd
program that compresses journal files when the correct
Severity: Informational
date has been reached. It erases journal files when the
deletion date arrives. Explanation: QXLELFSV has detected a change in
system date.
User Response: N/A
User Response: N/A
Programmer Response: N/A
Programmer Response: N/A
90 Creating->yyyymmdd
95 Renaming EJL:yyyymmdd
Severity: Informational
Severity: Informational
Explanation: The journal log file (which is also known
as the mega file) is being created for mm/dd/yyyy. Explanation: QXLELFSV has completed processing a
journal log file. A retention period has been set for the
User Response: N/A
journal logs. QXLELFSV is saving the journal log file. It
Programmer Response: N/A does this by moving the journal log file from the EJL:
directory to the EJLS: directory using a RENAME.
QXLELFSV is about to issue the rename.
91 Could not create-
>yyyymmdd...STOPPING User Response: N/A

Severity: Severe Programmer Response: N/A

Explanation: An error occurred while trying to create


the journal log file for mm/dd/yy. The QXLELFSV task 96 Extending EJL:yyyymmdd
will stop.
Severity: Informational
User Response: Call Headquarters
Explanation: This message will occur when the
Programmer Response: Examine EDJ error logs system date has been reset backwards. It is performing
(EDJLOGn, where n=1-7) to see if you can determine the same function as the preceding message, however,
cause of error. If not, send copies of error logs to IBM. it does so by adding the transactions that occurred after
the system date reset to the file that was created
previously when data for this date was processed. This
92 Unrecoverable Error...STOPPING should only happen due to user intervention.
Severity: Severe User Response: N/A
Explanation: An unrecoverable error occurred in Programmer Response: N/A
QXLELFSV. The QXLELFSV task will stop.
User Response: Call Headquarters. 97 Erasing EJL:yyyymmdd
Programmer Response: Examine EDJ error logs Severity: Informational
(EDJLOGn, where n=1-7) to see if you can determine
cause of error. If not, send copies of error logs to IBM. Explanation: QXLELFSV has completed processing a
journal log file. A retention period has been set for the
journal logs. QXLELFSV is erasing the journal log file.

63
User Response: N/A day’s mega file and is ready to advance to the next
date. QXLELFSV will not advance to the next date until
Programmer Response: N/A
it is certain that all transactions for the current date
have been processed. This means that QXLELFSV is
98 Cannot rename yet->EJL:yyyymmdd unable to contact one or more controllers within the
store network and so cannot be certain that all the
Severity: Informational transactions for that date have been processed. The
Explanation: QXLELFSV has failed in the attempt to QXLELFSV task will wait until it has access to all
rename or erase the journal log file. This condition controllers in its network.
implies that one or more registers have not closed the User Response: N/A
current processing date’s journal log. The QXLELFSV
task will wait until all registers have closed the current Programmer Response: N/A
date’s journal log.
User Response: N/A 130 Awaiting despool...
Programmer Response: N/A Severity: Informational
Explanation: QXLELFSV has reached end of file in a
99 Ready to process->EJL:yyyymmdd day’s mega file and is ready to advance to the next
date. QXLELFSV will not advance to the next date until
Severity: Informational it is certain that all transactions for the current date
Explanation: All processing required to switching have been processed. This message means that the
journal logs has been completed. QXLELFSV is ready QXLELFSV has detected that there are spool files on
to begin processing data for mm/dd/yyyy. one or more of the controllers in the store network
which may contain transactions for the current
User Response: N/A processing date. The QXLELFSV task will wait until all
Programmer Response: N/A spool files have been despooled before proceeding.
User Response: N/A
101, 102 Processing EJL:yyyymmdd Programmer Response: N/A
offset->nnnnn
Severity: Informational 131 Awaiting register closes
Explanation: QXLELFSV is processing a journal log. It Severity: Informational
is currently processing the record that begins at offset
nnnnn in the journal log. Explanation: QXLELFSV has reached end of file in a
day’s mega file and is ready to advance to the next
User Response: N/A date. QXLELFSV will not advance to the next date until
Programmer Response: N/A it is certain that all transactions for the current date
have been processed. This message means that the
QXLELFSV has detected that one or more registers
105, 106 Waiting...EJL:yyyymmdd eof -> nnnnn have not closed the current processing date’s journal
Severity: Informational log. The QXLELFSV task will wait until all registers have
closed the current date’s journal log.
Explanation: QXLELFSV is processing a journal log. It
is has reached the current end of file and is waiting for User Response: N/A
the registers to write more transactions. Programmer Response: N/A
User Response: N/A
Programmer Response: N/A

129 Missing controllers...waiting


Severity: Informational
Explanation: QXLELFSV has reached end of file in a

64 Electronic Journal User’s Guide




Printed in the United States of America


on recycled paper containing 10%
recovered post-consumer fiber.

You might also like