Skip to content

AP315 Program Details

Overview

AP315.rpg updates 'C' (Control) and 'T' (Transmitter) records in the AP1099 file with payment totals and payee counts based on 'B' (Payee) records.

Process Steps

  1. Initialization:
  2. Defines AP1099I as an update file (750 bytes, indexed).
  3. Sets TYPE to 'B' for reading Payee records.

  4. Read 'B' Records:

  5. Positions to first 'B' record (SETLL).
  6. Reads 'B' records (READE) until end-of-file (*IN55).
  7. Accumulates payment amounts (A3PAY1–A3PAYC) into W4TAM1–W4TAMC (15 digits, 2 decimals).
  8. Increments payee counter (W4CNT).

  9. Update 'C' Record:

  10. Chains to 'C' record (CHAIN).
  11. Sets total payment amounts (A4TAM1–A4TAMC) and payee count (A4CNT) from accumulated values.
  12. Clears dummy fields (DUM1–DUM12) to zeros.
  13. Updates record (EXCPT UPDREC).

  14. Update 'T' Record:

  15. Chains to 'T' record.
  16. Sets total payees (A1TPAY) to W4CNT.
  17. Updates record (EXCPT UPDREC).

  18. Termination:

  19. Sets *INLR to end program.

Business Rules

  • Processes only 'B' records for totaling payments and counting payees.
  • Updates 'C' record with payment totals and payee count.
  • Updates 'T' record with total payees.
  • Ensures IRS 1099 compliance for field positions and formats.

External Programs Called

  • None.

Tables Used

  • AP1099I (or <&FGRP>AP1099I): Index file for reading/updating records, 750 bytes.
  • Library: QS36F.