GL210 RPG36
The GL210.rpg36.txt
RPG program is called by the main OCL program (likely BB600.ocl36.txt
) within the invoice posting workflow on an IBM System/36 environment. Its primary function is to create general ledger (G/L) detail table entries by processing records from the GLDETLTR
file and writing them to the GLDETL
file. It uses the GLCONT
file for control data and generates detailed G/L entries for accounting purposes. The program handles transaction amounts, discounts, and various identifiers to ensure accurate G/L integration. Below is a detailed explanation of the process steps, business rules, tables used, and external programs called.
Process Steps of the GL210 RPG Program¶
The GL210
program reads records from GLDETLTR
, processes them to create G/L detail entries, and writes them to GLDETL
. It uses GLCONT
for control information and includes detailed fields for transaction tracking.
- File Initialization:
- The program opens the following files:
- Input Files:
GLDETLTR
: Primary input file (IPE
), 512 bytes per record, disk-based. Contains G/L transaction records.GLCONT
: Input file (IC
), 256 bytes, 2-byte alternate index, disk-based. Contains G/L control data.- Output File:
GLDETL
: Output file (O
), 132 bytes, add capability (A
), disk-based. Stores G/L detail entries.
-
Defines record format for
GLDETLTR
(NS 01
):ADCO
(7–8, 47–48, 49–50): Company number (multiple positions, likely for different contexts).ADCUST
(9–14): Customer number.COCUST
(9–14): Combined company and customer number.ADINV#
(15–21): Invoice number.ADMISC
(22–26): Transaction amount (8 digits, 2 decimals, packed).ADDISC
(27–30): Transaction discount (5 digits, 1 decimal, packed).ADGLCR
(31–38): G/L credit amount.ADGLDR
(39–46): G/L debit account.ADGLC6
(32–37): G/L credit amount (alternate format, 5 digits, 2 decimals).ADGLD6
(40–45): G/L debit account (alternate format, 5 digits, 3 decimals).ADJRDT
(52–57): Journal date.ADNAME
(51–75): Customer name.ADSHIP
(76–78): Ship-to code.ADORDN
(79–84): Order number.ADSRN
(85–87): Sales representative number.ADIND8
(88–95): Invoice date (8 digits).ADSHD8
(96–103): Ship date (8 digits).ADSLMN
(104–105): Salesman number.ADDSEQ
(106–108): Detail sequence number.ADITEM
(109–121): Item number.ADLOC
(109–111): Location code.ADPROD
(109–121): Product code.ADTANK
(122–125): Tank code.ADCNTR
(126–128): Container code.ADTAXC
(129–132): Tax code.
-
Record Processing (GLDETLTR):
- Reads each record from
GLDETLTR
sequentially using the RPG cycle (NS 01
). -
Chains to
GLCONT
using a 2-byte alternate index to retrieve control data (e.g., company-specific G/L settings,CRCO
). -
G/L Detail Entry Creation:
-
Writes records to
GLDETL
using exception output (E
) specifications at lines 31 or 33:- Common Fields:
'A'
: Entry type (position 1).CRCO
: Company number (fromGLCONT
).KYJRNL
: Journal number.DORC
: Debit or credit indicator.CRAMT
: Credit amount (packed).ADJRD8
: Journal date (8 digits).ADPGM
: Program name (likelyGL210
).SYDT
: System date.RCTY
: Record type.ADINV#
: Invoice number.ADCUST
: Customer number.ADSHIP
: Ship-to code.ADORDN
: Order number.ADSRN
: Sales representative number.ADIND8
: Invoice date.ADSHD8
: Ship date.ADSLMN
: Salesman number.ADDSEQ
: Detail sequence number.ADLOC
: Location code.ADPROD
: Product code.ADTANK
: Tank code.ADCNTR
: Container code.ADTAXC
: Tax code.- Line 31:
- Uses
CRACCT
(credit account fromGLCONT
). - Writes credit-related entries.
- Line 33:
- Similar to line 31 but may handle different account or amount types (e.g., debit entries).
- Includes a constant
'0000'
at position 19 for reference or padding.
-
Cycle Completion:
- Processes all
GLDETLTR
records, generating G/L detail entries inGLDETL
. - Terminates after processing, closing all files.
Business Rules¶
- G/L Detail Entry Creation:
- Creates detailed G/L entries in
GLDETL
for eachGLDETLTR
record, including transaction amounts, discounts, and account information. -
Supports both credit and debit entries based on
DORC
andCRACCT
. -
Detailed Transaction Tracking:
-
Includes extensive transaction details (e.g.,
ADINV#
,ADCUST
,ADNAME
,ADSHIP
,ADORDN
,ADSRN
,ADIND8
,ADSHD8
,ADSLMN
,ADDSEQ
,ADLOC
,ADPROD
,ADTANK
,ADCNTR
,ADTAXC
) for comprehensive G/L integration. -
Control Data:
-
Uses
GLCONT
to retrieve company-specific G/L settings (e.g.,CRCO
,CRACCT
) for accurate account mapping. -
No Validation or Filtering:
- Assumes all
GLDETLTR
records are valid and suitable for G/L entry creation. -
No explicit checks for amounts, dates, or account validity beyond chaining to
GLCONT
. -
No Error Handling:
-
Assumes input files (
GLDETLTR
,GLCONT
) exist and contain valid data, andGLDETL
can be written without issues. -
Integration with G/L Workflow:
- Part of the invoice posting workflow, creating G/L detail entries to support financial reporting and general ledger updates.
Tables (Files) Used¶
- GLDETLTR:
- Description: G/L transaction file.
- Attributes: 512 bytes per record, primary input file (
IPE
), disk-based. - Fields Used:
ADCO
: Company number.ADCUST
: Customer number.COCUST
: Combined company and customer number.ADINV#
: Invoice number.ADMISC
: Transaction amount (8.2, packed).ADDISC
: Transaction discount (5.1, packed).ADGLCR
: G/L credit amount.ADGLDR
: G/L debit account.ADGLC6
: G/L credit amount (alternate).ADGLD6
: G/L debit account (alternate).ADJRDT
: Journal date.ADNAME
: Customer name.ADSHIP
: Ship-to code.ADORDN
: Order number.ADSRN
: Sales representative number.ADIND8
: Invoice date.ADSHD8
: Ship date.ADSLMN
: Salesman number.ADDSEQ
: Detail sequence number.ADITEM
: Item number.ADLOC
: Location code.ADPROD
: Product code.ADTANK
: Tank code.ADCNTR
: Container code.ADTAXC
: Tax code.
- Purpose: Contains G/L transaction records to be processed.
-
Usage: Read sequentially to create G/L entries.
-
GLCONT:
- Description: General ledger control file.
- Attributes: 256 bytes per record, input file (
IC
), 2-byte alternate index, disk-based. - Fields Used:
CRCO
: Company number.CRACCT
: Credit account.
- Purpose: Provides control data for G/L processing.
-
Usage: Chained for company-specific settings.
-
GLDETL:
- Description: General ledger detail file.
- Attributes: 132 bytes per record, output file (
O
), add capability (A
), disk-based. - Fields Used:
'A'
: Entry type.CRCO
: Company number.CRACCT
: Credit account.KYJRNL
: Journal number.DORC
: Debit/credit indicator.CRAMT
: Credit amount (packed).ADJRD8
: Journal date (8 digits).ADPGM
: Program name.SYDT
: System date.RCTY
: Record type.ADINV#
,ADCUST
,ADSHIP
,ADORDN
,ADSRN
,ADIND8
,ADSHD8
,ADSLMN
,ADDSEQ
,ADLOC
,ADPROD
,ADTANK
,ADCNTR
,ADTAXC
: Transaction details.
- Purpose: Stores detailed G/L entries for accounting.
- Usage: Written with exception output (lines 31, 33).
External Programs Called¶
The GL210
RPG program does not explicitly call any external programs. It is a self-contained program that processes input from GLDETLTR
and GLCONT
and writes to GLDETL
.
Summary¶
The GL210
RPG program, called by the main OCL (e.g., BB600.ocl36.txt
), creates G/L detail entries by:
- Reading GLDETLTR
records with transaction details.
- Chaining to GLCONT
for company-specific control data (e.g., CRCO
, CRACCT
).
- Writing detailed G/L entries to GLDETL
with credit/debit indicators, amounts, and extensive transaction metadata (e.g., invoice, customer, product, tank, tax).
- Supporting both credit and debit entries based on DORC
.
- Terminating after processing all records.
Tables Used: GLDETLTR
(G/L transactions), GLCONT
(G/L control), GLDETL
(G/L detail entries).
External Programs Called: None.
This program supports the general ledger module of the invoice posting workflow by creating detailed G/L entries for accurate financial reporting and integration.