AP945C Program Details¶
Overview¶
AP945C.clp is a CL program that orchestrates the maintenance of the IRS 1099 file (AP1099), ensuring compliance through index creation, user-driven record updates, reorganization, total calculations, and sequence number updates.
Process Steps¶
- Retrieve Parameters:
- Accepts
&MODE(e.g., 'MNT' for maintenance) and&FGRP(e.g., 'G' for live, 'T' for test). -
Sets library to
QS36Fand file names (&FILE,&SAVE,&INDEX) based on&FGRP(e.g.,AP1099,AP1099SAV,AP1099Ior prefixed with&FGRP). -
Create Index:
-
Calls
AP945(OCL) to create index file&INDEXfor&FILE. -
Maintenance:
-
Overrides
AP1099to&FILEand callsAP945(RPGLE) with&MODEfor user-driven record maintenance (add/edit/delete/inquire). -
Backup and Reorganize (if &MODE = 'MNT'):
- Copies
&FILEto&SAVE, replacing existing records. -
Copies records back to
&FILEin order: 'T' (replace), 'A' (add), 'B' (add, excluding position 45 = 'Y'), 'C' (add), 'F' (add). -
Update Totals:
-
Calls
AP315to update 'C' and 'T' record totals based on 'B' records. -
Update Sequence Numbers:
-
Calls
AP3155to assign sequential numbers to all records in&FILE. -
Clean Up:
- Deletes index file
&INDEX.
Business Rules¶
- Ensures IRS 1099 compliance with record order and format.
- Supports live (
&FGRP = 'G') and test environments via dynamic file naming. - Maintains data integrity with backup to
&SAVE. - Excludes deleted 'B' records (position 45 = 'Y') during reorganization.
External Programs Called¶
AP945(OCL Procedure): Creates index file.AP945(RPGLE Program): Handles user maintenance/inquiry.AP315(RPG Program): Updates totals in 'C' and 'T' records.AP3155(RPG Program): Updates sequence numbers.
Tables Used¶
- AP1099 (or
<&FGRP>AP1099): Main 1099 data file, updated and reorganized. - AP1099I (or
<&FGRP>AP1099I): Index file, created and deleted. - AP1099SAV (or
<&FGRP>AP1099SV): Backup file for pre-maintenance data. - Library:
QS36F.