Skip to content

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:

  1. Company Validation:
  2. The program checks if the company number (ACCO) in the ARCONT file matches the value 10 (IFNE 10).
  3. If ACCO is not equal to 10, the program branches to the END tag, effectively terminating without performing any updates.
  4. This ensures that the program only processes records for company number 10.

  5. Set Journal Type and Number:

  6. If the company number is 10, the program sets the journal type (TYPE) to 'SJ' (Sales Journal) in the User Data Structure (UDS).
  7. It moves the current Sales Journal number (ACSLJ#) from the ARCONT record to the SL# field in the UDS for reference.
  8. Increments the ACSLJ# field by 1 to prepare the next journal number.

  9. Update ARCONT File:

  10. The program executes an exception output (EXCPT) to write the updated ACSLJ# value back to the ARCONT file.
  11. The output specification (OARCONT E) writes the ACSLJ# field to positions 36–37 of the ARCONT record.

  12. Termination:

  13. The program reaches the END tag and terminates, either after updating the ACSLJ# for company 10 or if the company number does not match.

Business Rules

  1. Company-Specific Processing:
  2. The program only processes records where the company number (ACCO) is 10. This restricts the update to a specific company, ensuring that the Sales Journal number is incremented only for the designated company.

  3. Sales Journal Number Increment:

  4. The Sales Journal number (ACSLJ#) is incremented by 1 each time the program runs for company 10, ensuring a unique journal number for each sales posting transaction.
  5. The journal type is set to 'SJ' (Sales Journal) to indicate the type of journal entry being tracked.

  6. File Update:

  7. The ARCONT file is updated directly with the new ACSLJ# value, maintaining the next available Sales Journal number for subsequent transactions.

  8. No Error Handling:

  9. The program does not include explicit error handling or validation beyond the company number check. It assumes the ARCONT file is accessible and the record for company 10 exists.

Tables (Files) Used

  1. ARCONT:
  2. Description: Accounts Receivable control file.
  3. Attributes: 256 bytes, 2-byte key, update-capable (UP), alternate index (AI).
  4. 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.
  5. Purpose: Stores control information for A/R processing, specifically the next Sales Journal number (ACSLJ#) for the company.
  6. Usage: The program reads the ARCONT record, checks the company number, increments ACSLJ#, and updates the record.
  7. Disposition: Update-capable (UP), shared access (DISP-SHR as specified in BB630.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.