GB730P RPGLE
The provided document is an RPGLE program named GB730P
, called from the OCL procedure BB943INQ.ocl36.txt
in the IBM System/36 (or AS/400 compatibility mode) environment. This program, titled "Global File Tracking History Inquiry," is designed to display historical tracking data for various files related to customer sales agreements, pricing, freight, and order details. It uses a display file (gb730pd
) with a subfile (SFL1
) to present data interactively. Due to the significant truncation of the source code (579,116 characters), critical sections like the main processing logic and subroutines are missing, limiting the ability to fully describe the process steps. However, based on the available code, file definitions, and context from related programs (BB943
, BB943V
, BB9433
, BB944
, GSDTCLC1
), I’ll provide a reconstructed explanation of the process steps, business rules, tables used, and external programs called.
Process Steps of the RPGLE Program¶
The GB730P
program is an interactive inquiry module that retrieves and displays historical data from multiple files, focusing on tracking changes to customer sales agreements (bicuaghx
), pricing, freight, and order-related data. It likely allows users to filter and view records via a subfile in the gb730pd
display file. The following process steps are inferred from the provided code and context:
- Initialization (
*inzsr
Subroutine, Not Shown): - Receive Parameters: The program likely accepts parameters via the
*ENTRY
plist, such as:- Company number (
p$cono
, inferred from related programs likeBB944
). - Selection criteria (e.g., customer, sequence number, date range).
- File group (
p$fgrp
,'G'
or'Z'
for file overrides). - Return flag (
p$flag
, e.g.,'1'
for success,'0'
for failure).
- Company number (
- Set System Information: Uses the program status data structure (implied, similar to
psds##
inBB944
) to retrieve:- Program name.
- User ID.
- Job date (
ps#mdy
, MMDDYY). - Job time (
ps#hms
, HHMMSS).
- Set Date/Time: Uses a date conversion data structure (
d#cymd
, etc.) to handle date formatting (e.g., converting CCYYMMDD to MMDDYY for display). - Initialize Display File: Prepares
gb730pd
and subfileSFL1
(relative record numberRRN1
) for displaying historical records. -
Open Database Tables: Calls a subroutine (likely
opntbl
, similar to other programs) to apply file overrides and open files. -
Open Database Tables (Implied
opntbl
Subroutine): - File Overrides: Applies overrides based on
p$fgrp
('G'
or'Z'
) usingOVG
orOVZ
arrays (e.g.,OVRDBF FILE(bicuag) TOFILE(*LIBL/gbicuag)
for'G'
). Executes overrides withQCMDEXC
. - Open Files: Opens all files defined in the F-specs with
USROPN
:- Master files:
glcont
,shiptz
,shipthx
,arcup31
,arcuphx
,cuadrx
,cuadrhx
,arcusz
,arcushx
,arcuspx
,arcusphx
,bicuag
,bicuaghx
,bbprce
,bbprcehx
,bbndfi
,bbndfihx
,bbcfsh
,bbcfshhx
,bbcfsd
,bbcfsdhx
,bicuf2
,bicufrhx
,gsprod
,gsprodhx
,gshazm
,gshazmhx
,gsumcv
,gsumcvhx
,gsctum
,gsctumhx
,gsctwt
,gsctwthx
,biprt2
,biprtxhx
,gscntr1
,gscntrhx
,bbordh
,bborhhsx
,bbordd
,bbordhsx
,bbordm
,bbormhsx
,gbfmsg
. - Display file:
gb730pd
(workstation file with subfileSFL1
).
- Master files:
-
Purpose: Ensures access to the correct file library (
G
orZ
) for retrieving historical data. -
Process User Input (Main Loop, Truncated):
- Display Screen: Writes to
gb730pd
, likely showing a selection panel for users to input criteria (e.g., company, customer, date range) and a subfile (SFL1
) for historical records. - Handle Input: Processes user input, such as:
- Selection criteria to filter records (e.g., customer number, moved to screen per
jk01
). - Function keys (e.g.,
F12
to exit,ENTER
to display results,PAGEDN
to scroll subfile).
- Selection criteria to filter records (e.g., customer number, moved to screen per
- Retrieve Data: Chains or reads from relevant files based on user input, populating
SFL1
with historical records (e.g., frombicuaghx
for sales agreements,bbordhsx
for order headers). -
Display Headers: Uses
HDR
array (22 elements, e.g., "Customer Sales Agreement Tracking", "Open Order Header Tracking") to label different file types. -
Populate Subfile (
SFL1
, Truncated): - Load Records: Iterates through historical files (e.g.,
bicuaghx
,bbprcehx
,bbordhsx
) based on selection criteria, writing records toSFL1
with relative record numberRRN1
. - Field Mapping: Maps file fields to subfile fields, including:
- Sales agreement details (
bicuaghx
:hhcono
,hhcust
,hhloc
,hhcntr
,hhpr01
–hhpr10
,hhprce
,hhoffp
perjk02
,hhpoor
perjk06
). - Order details (
bbordhsx
,bbordd
,bbormhsx
, added perjk04
). - Freight details (
bbcfsdhx
,BKFSPC
revised to 5.2 packed perjb07
,jb08
).
- Sales agreement details (
-
Handle Errors: Displays error messages from
COM
array (e.g., "Cannot Enter both Sys And Program Id") using message subfile (GSMSGF
). -
Message Handling (Implied
clrmsg
Subroutine): - Clear Messages: Likely calls
QMHRMVPM
(as inBB944
) to clear the message subfile. -
Display Messages: Uses
m@msgf
(GSMSGF
),m@rmvk
, and other message fields to show errors or status messages. -
Program Termination (Truncated):
- Closes all files (
close *all
). - Sets
*inlr = *on
to terminate. - Returns
p$flag
to indicate success or failure.
Business Rules¶
The program enforces the following business rules for tracking history inquiry:
- File Selection:
- Supports inquiry into multiple historical files, including:
- Customer sales agreements (
bicuaghx
). - Rack pricing (
bbprcehx
). - National diesel fuel index (
bbndfihx
). - Carrier fuel surcharge header/detail (
bbcfshhx
,bbcfsdhx
). - Customer freight (
bicufrhx
). - Product codes (
gsprodhx
), hazmat/shipping (gshazmhx
), unit of measure conversions (gsumcvhx
,gsctumhx
), weights (gsctwthx
), tax codes (biprtxhx
), containers (gscntrhx
). - Order headers, details, and miscellaneous (
bborhhsx
,bbordhsx
,bbormhsx
, perjk04
).
- Customer sales agreements (
-
Users select which file’s history to view (based on
HDR
array). -
Customer Input (per
jk01
): -
Customer number is input via the screen rather than passed as a parameter, allowing flexible filtering.
-
Field Enhancements:
- Supports expanded price fields (
BAPRCE
,BAOFFP
, 9.4 packed, perjk02
). - Includes sequence number (
BFTSEQ
) in freight tracking (bicuf2
, perjk03
). - Supports container codes in
gscntr1
(perjk03
). - Includes order-related files (
bbordh
,bbordd
,bbordm
, perjk04
) with renamed deletion field (BDDDEL
toBDDEL
, perjk05
). - Supports PO/order code (
BAPOOR
) inbicuag
(perjk06
). -
Uses revised freight surcharge field (
BKFSPC
, 5.2 packed, perjb07
,jb08
). -
Error Handling:
- Prevents entering both system and program IDs simultaneously (
COM(1)
: "Cannot Enter both Sys And Program Id"). -
Displays errors in the message subfile using
GSMSGF
. -
File Overrides:
- Uses
G
orZ
file groups (OVG
,OVZ
) to access different libraries (e.g.,gbicuag
,zbicuag
). -
Removed
empmas
andemphisz
(perjb07
). -
Display and Navigation:
- Uses subfile
SFL1
to display historical records. - Supports function keys (e.g.,
F12
to exit,ENTER
to refresh,PAGEDN
to scroll). - Displays headers from
HDR
array to indicate the file being viewed.
Tables Used¶
The program uses the following files, as defined in the File Specification (F-spec) section:
- gb730pd: Display file (workstation file) with subfile
SFL1
for user interaction. - glcont: Company file, input-only, keyed.
- shiptz, shipthx: Ship-to files, input-only, keyed.
- arcup31, arcuphx, cuadrx, cuadrhx, arcusz, arcushx, arcuspx, arcusphx: Customer-related files, input-only, keyed.
- bicuag, bicuaghx: Sales agreement and history files, input-only, keyed.
- bbprce, bbprcehx: Rack pricing files, input-only, keyed.
- bbndfi, bbndfihx: National diesel fuel index files, input-only, keyed.
- bbcfsh, bbcfshhx, bbcfsd, bbcfsdhx: Carrier fuel surcharge header/detail files, input-only, keyed.
- bicuf2, bicufrhx: Customer freight tracking files, input-only, keyed.
- gsprod, gsprodhx: Product code files, input-only, keyed.
- gshazm, gshazmhx: Hazmat/shipping description files, input-only, keyed.
- gsumcv, gsumcvhx, gsctum, gsctumhx, gsctwt, gsctwthx: Unit of measure conversion and weight files, input-only, keyed.
- biprt2, biprtxhx: Product tax code files, input-only, keyed.
- gscntr1, gscntrhx: Container code files, input-only, keyed.
- bbordh, bborhhsx, bbordd, bbordhsx, bbordm, bbormhsx: Order header, detail, and miscellaneous files, input-only, keyed (with renamed record formats
bbordhsr
,bbormhsr
). - gbfmsg: Message file, input-only, keyed.
Removed Files (per jb07
):
- empmas
, emphisz
.
File Overrides:
- OVG
and OVZ
arrays (46 elements each) map files to G
or Z
libraries (e.g., gglcont
, zbicuaghx
).
External Programs Called¶
The program likely calls the following external program, based on patterns in related programs (BB944
, etc.):
- QCMDEXC (Implied):
- Used in the
opntbl
subroutine (not shown due to truncation) to execute file override commands. -
Parameters: Override command string (80 bytes), length (15.5).
-
QMHRMVPM (Implied):
- Likely used in a
clrmsg
subroutine to clear the message subfile, as seen inBB944
. - Parameters: Message file (
m@msgf = 'GSMSGF *LIBL '
), stack counter (m@scnt
), remove key (m@rmvk
), remove option (m@rmv
), error code (m@errc
).
No other external programs are explicitly referenced, though GSDTCLC1
may be called for date calculations (e.g., converting or validating dates for display).
Summary¶
- Process Steps (Inferred):
- Initialize by receiving parameters (e.g.,
p$cono
,p$fgrp
), setting date/time, and preparinggb730pd
. - Apply file overrides and open files (
opntbl
). - Process user input (selection criteria, function keys) to filter historical records.
- Populate subfile
SFL1
with records from historical files (e.g.,bicuaghx
,bbordhsx
). - Handle errors via message subfile (
GSMSGF
). -
Terminate, closing files and returning
p$flag
. -
Business Rules:
- Displays history for multiple files (sales agreements, pricing, freight, orders, etc.).
- Allows customer number input via screen (per
jk01
). - Supports expanded fields (
BAPRCE
,BAOFFP
, perjk02
;BFTSEQ
, perjk03
;BAPOOR
, perjk06
;BKFSPC
, perjb07
,jb08
). - Prevents simultaneous system and program ID entry (
COM(1)
). - Uses
G
orZ
file groups for overrides. -
Displays headers (
HDR
) to indicate file type. -
Tables Used:
-
gb730pd
,glcont
,shiptz
,shipthx
,arcup31
,arcuphx
,cuadrx
,cuadrhx
,arcusz
,arcushx
,arcuspx
,arcusphx
,bicuag
,bicuaghx
,bbprce
,bbprcehx
,bbndfi
,bbndfihx
,bbcfsh
,bbcfshhx
,bbcfsd
,bbcfsdhx
,bicuf2
,bicufrhx
,gsprod
,gsprodhx
,gshazm
,gshazmhx
,gsumcv
,gsumcvhx
,gsctum
,gsctumhx
,gsctwt
,gsctwthx
,biprt2
,biprtxhx
,gscntr1
,gscntrhx
,bbordh
,bborhhsx
,bbordd
,bbordhsx
,bbordm
,bbormhsx
,gbfmsg
. -
External Programs Called:
QCMDEXC
(implied for file overrides).QMHRMVPM
(implied for message clearing).
Due to the severe truncation of the source code, critical logic (e.g., main loop, subfile processing) is missing, limiting the detail of the process steps. If you can provide the complete GB730P.rpgle
code or specific sections (e.g., main loop, subroutines), I can refine the analysis. Additionally, if you have the display file (gb730pd
) or related programs, I can provide more context. Let me know how you’d like to proceed!