BB630 RPG36
The RPG program BB630.rpg36.txt is called by the BB630.ocl36.txt OCL program, which itself is part of the invoice posting workflow initiated by BB600P.ocl36.txt. This program is responsible for updating the Accounts Receivable (A/R) control file (ARCONT) by incrementing the Sales Journal (S/J) number (ACSLJ#). Below is a detailed explanation of the process steps, business rules, tables used, and external programs called.
Process Steps of the BB630 RPG Program¶
The BB630 program is a concise RPG program that performs a specific task: updating the next Sales Journal number in the ARCONT file for a specific company. It operates on a single file and has minimal logic, focusing on ensuring the correct company is processed and updating the journal number.
Process Steps:¶
- Company Validation:
- The program checks if the company number (
ACCO) in theARCONTfile matches the value10(IFNE 10). - If
ACCOis not equal to10, the program branches to theENDtag, effectively terminating without performing any updates. -
This ensures that the program only processes records for company number
10. -
Set Journal Type and Number:
- If the company number is
10, the program sets the journal type (TYPE) to'SJ'(Sales Journal) in the User Data Structure (UDS). - It moves the current Sales Journal number (
ACSLJ#) from theARCONTrecord to theSL#field in theUDSfor reference. -
Increments the
ACSLJ#field by 1 to prepare the next journal number. -
Update ARCONT File:
- The program executes an exception output (
EXCPT) to write the updatedACSLJ#value back to theARCONTfile. -
The output specification (
OARCONT E) writes theACSLJ#field to positions 36–37 of theARCONTrecord. -
Termination:
- The program reaches the
ENDtag and terminates, either after updating theACSLJ#for company10or if the company number does not match.
Business Rules¶
- Company-Specific Processing:
-
The program only processes records where the company number (
ACCO) is10. This restricts the update to a specific company, ensuring that the Sales Journal number is incremented only for the designated company. -
Sales Journal Number Increment:
- The Sales Journal number (
ACSLJ#) is incremented by 1 each time the program runs for company10, ensuring a unique journal number for each sales posting transaction. -
The journal type is set to
'SJ'(Sales Journal) to indicate the type of journal entry being tracked. -
File Update:
-
The
ARCONTfile is updated directly with the newACSLJ#value, maintaining the next available Sales Journal number for subsequent transactions. -
No Error Handling:
- The program does not include explicit error handling or validation beyond the company number check. It assumes the
ARCONTfile is accessible and the record for company10exists.
Tables (Files) Used¶
- ARCONT:
- Description: Accounts Receivable control file.
- Attributes: 256 bytes, 2-byte key, update-capable (
UP), alternate index (AI). - Fields Used:
ACDEL(1 byte, position 1): Delete flag.ACCO(2 bytes, positions 2–3): Company number.ACNAME(30 bytes, positions 4–33): Company name.ACSLJ#(2 bytes, positions 36–37): Next Sales Journal number.
- Purpose: Stores control information for A/R processing, specifically the next Sales Journal number (
ACSLJ#) for the company. - Usage: The program reads the
ARCONTrecord, checks the company number, incrementsACSLJ#, and updates the record. - Disposition: Update-capable (
UP), shared access (DISP-SHRas specified inBB630.ocl36.txt).
External Programs Called¶
The BB630 RPG program does not explicitly call any external programs. It is a self-contained program that performs a single, focused task of updating the ARCONT file.
Summary¶
The BB630 RPG program is a simple utility called by BB630.ocl36.txt to update the Sales Journal number (ACSLJ#) in the ARCONT file for company number 10. It:
- Validates that the company number is 10.
- Sets the journal type to 'SJ' and increments the Sales Journal number.
- Updates the ARCONT file with the new journal number.
- Terminates without further processing if the company number does not match.
Tables Used: ARCONT (Accounts Receivable control file).
External Programs Called: None.
This program is likely invoked as part of the invoice posting process to ensure that each posting transaction receives a unique Sales Journal number, maintaining accurate A/R tracking for the specified company.