Sample COBOL
What IS COBOL?
Common Business Oriented Language
Rear Admiral Grace Brewster Murray Hopper was responsible not only for the development of the Cobol language but also for the continuous pressure within the industry to make computers and computing more accessible and to bring the research and career interests of women in computing to the forefront.
COBOL is a compiled English-like computer programming language designed for business use. It is an imperative, procedural and, since 2002, object-oriented language. COBOL is primarily used in business, finance, and administrative systems for companies and governments
This is/was a Real Program used to compute Investible Balances for First City National Bank in Houston Texas about 1970. It was a control/reporting progam that had multiple external file/inputs.
IDENTIFICATION DIVISION.
PROGRAM-ID. AAM020.
AUTHOR. SKIP STEIN.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-370.
OBJECT-COMPUTER. IBM-370.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT PRINTER ASSIGN TO UT-S-PRINTER.
SELECT SPOOL-REPORTS ASSIGN TO UT-S-SPOOL.
DATA DIVISION.
FILE SECTION.
FD PRINTER
RECORDING MODE IS F,
RECORD CONTAINS 133 CHARACTERS,
BLOCK CONTAINS 0 RECORDS,
DATA RECROT IS PRINT-LINE.
01 PRINTER-LINE-OUT.
02 CARR-CTL PIC X.
02 PRINT-LINE PIC X(132).
WORKING-STORAGE SECTION.
77 W-S PIC X(21) VALUE '***WORKING STORAGE***'
77 BRANCH-COUNT PIC S9(4) COMP-3 VALUE ZEROS.
77 CUST-COUNT PIC S9(4) COMP-3 VALUE ZEROS.
77 PREV-AACD-USER-ID PIC 9(3) COMP-3 VALUE ZEROS.
77 MISC-COUNTER PIC 9(4) COMP-3 VALUE ZEROS.
77 SEARCH-USER-ID PIC 9(3) COMP-3 VALUE ZEROS.
77 SEARCH-BRANCH PIC S9(2) COMP-3 VALUE ZEROS.
77 PR-CUSTOMER PIC X(40) VALUE SPACES.
77 FM-CODE PIC S9(3) COMP-3 VALUE ZEROS.
77 PR-BRANCH PIC X(40) VALUE SPACES.
77 SERVICE-CHARGE PIC S9(11)V9(4) COMP-3 VALUE +0.
77 T-BILL-RATE PIC S9(5)V9(4) COPM-3 VALUE +0.
77 REQUIRED-RESERVES PIC S9(5)V9(4) COMP-3 VALUE ZEROS.
77 AAM-SAVE PIC X(330) VALUE SPACES.
77 WORK-REC-SAVE PIC X(194) VALUE SPACES.
77 NO-TRANS PIC 99 VALUE 1 COMP-3.
77 NO-HISTORY PIC 99 COMP-3 VALUE 1.
77 GEN-SEQ-NUM PIC 9(5) COMP-3 VALUE 90000.
77 DDA-DEBIT-TRAN PIC 9(5) COMP-3 VALUE 10020.
77 DDA-CREDIT-TRAN PIC 9(5) COMP-3 VALUE 10030.
77 MAINT-TRAN-CODE PIC 9(5) COMP-3 VALUE 10010.
77 ITEM-TRAN-CODE PIC 9(5) COMP-3 VALUE 10040.
77 REDUCED-ITEM-TRAN PIC 9(5) COMP-3 VALUE 10050.
77 LOCAL-ITEM-TRAN PIC 9(5) COMP-3 VALUE 930.
77 OTHER-ITEM-TRAN PIC 9(5) COMP-3 VALUE 940.
77 DDA-AD-VOLOREM PIC ((5) COMP-3 VALUE 90999.
77 AD-VOLOREM-RATE PIC S9V9(7) COMP-3 VALUE 0.0002349.
77 MAX-LINES PIC 9(3) COMP-3 VALUE 56.
77 INVESTIBLE-REQUIRED PIC S9(11)V9(4) VALUE ZEROS.
77 WORK-NUMBER PIC S9(11)V9(4) VALUE ZEROS.
77 TOTAL-REQ-INV-BAL PIC S9(11)V9(4) COMP-3 VALUE ZEROS.
77 DDA-TOTAL-SUB PIC S99 COMP VALUE ZEROS.
77 LOOP-LIMIT PIC S99 COMP-3 VALUE ZEROS.
77 LOOP-CONTROL PIC S99 COMP-3 VALUE ZEROS.
77 TABLE-LIMIT PIC 9(3) COMP-3 VALUE 9.
77 PRINTING-CONTROL PIC S99 COMP-3 VALUE ZEROS.
77 TOT-CUST-UNITS PIC S9(11)V9(4) COMP-3 VALUE ZEROS.
77 TOT-CUST-SERVICES PIC S9(11)V9(4) COMP-3 VALUE ZEROS.
77 SCHG-HOLD PIC S9(11)V9(4) COMP-3 VALUE ZEROS.
77 UNITS-COUNT PIC S9(11)V9(4) COMP-3 VALUE ZEROS.
77 TOT-CUST-TRANS PIC S((11)V9(4) COMP-3 VALUE ZEROS.
77 DDA-SUB PIC S99 COMP VALUE ZEROS.
77 TRANSACTION-COUNT PIC 9(11) COMP-3 VALUE ZEROS.
01 AA-MASTER-RECORD COPY AAMAAM.
01 AA-MASTER-RECORD.
02 AAM-CUSTOMER PIC X(4).
02 AAM-CUSTOMER-BREAK REDEFIENS AAM-CUSTOMER.
03 AAM-USER-ID PIC 9(3) COMP-3.
03 AAM-BRANCH PIC 9(2) COMP-3.
02 AAM-PARENT-IDENTIFIER PIC X.
02 AAM-DORMANT-FLAG PIC X.
02 AAM-ACCOUNT-ID PIC X(9).
02 AAM-ACCOUNT-ID-BREAK REDEFINES AAM-ACCOUNT-ID.
03 AAM-ACCT-APPL-CODE PIC X(2).
88 DDA-EXTRACT VALUE 'DD'.
03 AAM-CHK-DIGIT PIC 9 COMP-3.
03 AAM-ACCT-NUMBER PIC 9(10) COMP-3.
02 AAM-PARENT-ID PIC X(9).
02 AAM-PARENT-ID-BREAK REDEIFIES AAM-PARENT-ID.
03 AAM-PARENT-AAPPL-CODE PIC X(2).
03 AAM-PARENT CHK-DIGIT PIC 9 COMP-3.
03 AAM-PARENT-NUMBER PIC 9(10) COMP-3.
02 AAM-SHORT-TITLE PIC X(13).
02 AAM-AREA-REFERENCE PIC 9(9) COMP-3.
02 AAM-S-I-C PIC 9(5) COMP-3.
02 AAM-OFFICER-NUMBER PIC 9(5) COMP-3.
02 AAM-DEPARTMENT PIC 9(5) COMP-3.
02 AAM-DIVISION PIC X.
02 AAM-ACCOUNT-TYPE PIC X.
02 AAM-DATE-OPENED PIC 9(6) COMP-3.
02 AAM-STATEMENT-CYCLE PIC 9(3) COMP-3.
02 AAM-O-D-LIMIT PIC (97) COMP-3.
02 AAM-MASTER-RECORD-PRINT PIC X.
02 AAM-N-A-FLAG PIC 9 COMP-3.
02 AAM-STMT-FLAG PIC 9 COMP-3.
02 AAM-CB-REGION PIC 9(3) COMP-3.
02 AAM-STATEMENT-BALANCE PIC S9(11)V99 COMP-3.
02 AAM-AVERAGE-LEDGER PIC S9(11)V99 COMP-3.
02 AAM-INVESTIBLE PIC S9(11)V99 COMP-3.
02 AAM-INVESTIBLE-REQ PIC S9(11)V99 COMP-3.
02 AAM-COLLECTED PIC S9(11)V99 COMP-3.
02 SERVICES PIC S9(11)V99 COMP-3.
02 AAM-LAST-MAINT-DATE PIC 9(6) COMP-3.
02 AAM-INVESTIBLE-HISTORY PIC S9(11) COMP-3,
OCCURS 12 TIMES INDEXED BY INV-SUB.
02 AAM-SERVICE-HISTORY PIC S9(11) COMP-3,
OCCURS 12 TIMES INDEXED BY SERV-SUB.
02 AAM-INV-REQ-HISTORY PIC S9(11) COMP-3,
OCCURS 12 TIMES INDEXED BY REQ-SUB.
01 AA-SERVICE-MASTER COPY AAMAASM.
01 AA-SERVICE-MASTER.
02 AASM-KEY PIC X(5).
02 AASM-KEY-BREAK REDEFINES AASM-KEY.
03 AASM-USER-ID PIC 9(3) COMP-3.
03 AASM-TRAN-CODE PIC 9(5) COMP-3.
02 AASM-UNIT-RATE PIC S9(9)V9(4) COMP-3.
02 AASM-INCR-DECR PIC X.
02 AASM-DATE-ACTIVATED PIC 9(6) COMP-3.
02 AASM-DESCRIPTION-COUNT PIC 9 COMP-3.
02 AASM-DESCRIPTION PIC X(30)
OCCURS 1 TO 4 TIMES
DEPENDING ON AASM-DESCRIPTION-COUNT
INDEXED BY SM-DESC-SUB.
01 AA-TRAN-WORK-REC COPY AAMATWR.
01 AA-TRAN-WORK-REC.
02 ATWR-HISTORY-PORTION.
05 ATWR-TRAN-CODE PIC 9(5) COMP-3.
05 ATWR-CUSTOMER PIC X(4).
05 ATWR-CUSTOMER-BREAK REDEFINES ATWR-CUSTOMER.
10 ATWR-USER-ID PIC 9(3) COMP-3.
10 ATWR-BRANCH PIC 9(2) COMP-3.
05 ATWR-ACCOUNT-ID PIC X(9).
05 ATWR-ACCOUNT-ID-BREAK REDEFINES ATWR-ACCOUNT-ID.
10 ATWR-ACCT-APPL-CODE PIC X(2).
10 ATWR-CHK-DIGIT PIC 9 COMP-3.
10 ATWR-ACCT-NUMBER PIC 9(10) COMP-3.
05 ATWR-SEQ-NUMBER PIC 9(5). COMP-3.
05 ATWR-TRAN-DATE PIC 9(6) COMP-3.
03 ATWR-VARIABLE.
05 ATWR-PARENT-IDENTIFIER PIC X.
05 ATWR-PARENT-ID PIC X(9).
05 ATWR-PARENT-ID-BREAK REDEFINES ATWR-PARENT-ID.
10 ATWR-PARENT-APPL-CODE PIC X(2).
10 ATWR-PARENT-CHK-DIGIT PIC 9 COMP-3.
10 ATWR-PARENT-NUMBER PIC 9(10) COMP-3.
05 ATWR-UNITS PIC S9(9)V9(4) COMP-3.
05 ATWR-UNIT-RATE PIC S9(9)V9(4) COMP-3.
05 ATWR-INVST-BAL-UNIT PIC S9(9)V9(4) COMP-3.
05 ATWR-S-I-C PIC 9(5) COMP-3.
05 ATWR-AREA-REFERENCE PIC 9(9) COMP-3.
05 ATWR-OFFICER-NUMBER PIC 9(5) COMP-3.
05 ATWR-DEPARTMENT PIC 9(5) COMP-3.
03 ATWR-FM-ALTER REDEFINES ATWR-VARIABLE.
05 ATWR-FROM-FIELD PIC X(14).
05 ATWR-TO-FIELD PIC S(14).
05 FILLER PIC X(17).
03 REST-OF-RECORD.
05 ATWR-N-A-CODE PIC 9 COMP-3.
05 ATWR-STMT-CODE PIC 9 COMP-3.
05 ATWR-ACCOUNT-TYPE PIC X.
05 ATWR-CORR-BANK-REGION PIC 9(3) COMP-3.
02 NOT-PART-OF-HISTORY.
03 ATWR-DESCRIPTION-COUNT PIC 9 COMP-3.
03 ATWR-DESCRIPTION OCCURS 1 TO 4 TIMES,
DEPENDING ON ATWR-DESCRIPTION-COUNT
INDEXED BY TW-DESC-SUB PIC X(30).
01 AA-HISTORY-RECORD COPY AAMHIST.
01 AA-HISTORY-RECORD.
05 ATHR-TRAN-CODE PIC 9(5) COMP-3.
05 ATHR-CUSTOMER PIC X(4).
05 ATHR-CUSTOMER-BREAK REDEFINES ATHR-CUSTOMER.
10 ATHR-USER-ID PIC 9(3) COMP-3.
10 ATHR-BRANCH PIC 9(2) CMOP-3.
05 ATHR-ACCOUNT-ID PIC X(9).
05 ATHR-ACCONT-ID-BREAK REDEFINES ATHR-ACCOUNT-ID.
10 ATHR-ACCT-APPL-CODE PIC X(2).
10 ATHR-CHK-DIGIT PIC 9 COMP-3.
10 ATHR-ACCOUNT-NUMBER PIC 9(10) COMP-3.
05 ATHR-SEQ-NUMBER PIC 9(5) COMP-3.
05 ATHR-TRAN-DATE PIC 9(6) COMP-3.
05 AHTR-PARENT-IDENTIFIER PIC X.
05 ATHR-PARENT-ID PIC X(9).
05 ATHR-PARENT-ID-BREAK REDEFINES ATHR-PARENT-ID.
10 ATHR-PARENT-APPL-CODE PIC X(2).
10 ATHR-PARENT-CHK-DIGIT PIC 9 COMP-3.
10 ATHR-PARENT-NUMBER PIC 9(10) COMP-3.
05 ATHR-UNITS PIC S9(9)V9(4) COMP-3.
05 ATHR-UNIT-RATE PIC S9(9)V9(4) COMP-3.
05 ATHR-S-I-C PIC 9(5) COMP-3.
05 ATHR-AREA-REFERENCE PIC 9(9) COMP-3.
05 ATHR-OFFICER-NUMBER PIC 9(5) COMP-3.
05 ATHR-DEPARTMENT PIC 9(5) COMP-3.
05 ATHR-N-A-CODE PIC 9 COMP-3.
05 ATHR-STMT-CODE PIC 9 COMP-3.
05 ATHR-ACCOUNT-TYPE PIC X.
05 ATHR-CORR-BANK-REGION PIC 9(3) COMP-3.
01 FILE-MAINT-BREAK.
05 FILE-MAINT PIC X(14).
05 FM-10 REDEFINES FILE-MAINT.
10 FM-AMT-2D PIC 9(11)V99.
10 FM-AMT-4D REDEFINES FM-AMT-2D PIC 9(9)V9(4).
10 FM-AMT-SGN PIC X.
05 FM-20 REDEFINES FM-10.
10 FM-HST-AMT PIC 9(11).
10 FM-HST-SGN PIC X.
10 FILLER PIC X(2).
05 FM-30 REDEFINES FM-20.
10 FM-AREA PIC 9(9).
10 FILLER PIC X(5).
05 FM-40 REDEFINES FM-30.
10 FM-CORR PIC 9(3).
10 FILLER PIC X(11).
05 FM-50 REDEFINES FM-40.
10 FM-FLAG PIC 9.
10 FILLER PIC X(13).
05 FM-60 REDEFINES FM-50.
10 FM-SHRT-NM PIC X(13).
10 FILLER PIC X.
05 FM-70 REDEFINES FM-60.
10 FM-SIC PIC 9(5).
10 FILLER PIC X(9).
05 FM-80 REDEFINES FM-70.
10 FM-OFF PIC 9(5).
10 FILLER PIC X(9).
05 FM-90 REDEFINES FM-80.
10 FM-DEPT PIC 9(5).
10 FILLER PIC X(9).
05 FM-150 REDEFINES FM-90.
10 FM-CB PIC 9(3).
10 FILLER PIC X(11).
05 FM-TRAN-BREAK PIC 9(5).
05 FM-TB REDEFINES FM-TRAN-BREAK.
10 FILLER PIC XX.
10 FM-TYPE PIC 9.
88 FM-INV VALUE 3.
88 FM-SRV VALUE 4.
88 FM-REQ VALUE 5.
10 FM-SUB PIC 99.
01 AA-CUSTOMER-DESCRIPTION.
05 AACD-USER-ID PIC 9(3).
05 AACD-BRANCH PIC 9(2).
05 AACD-DESCRIPTION PIC X(40).
05 FILLER PIC X(35).
01 R0-HD2-LINE.
05 FILLER PIC X(12) VALUE ' PROGRAM = '.
05 FILLER PIC X(8) VALUE ' AAM020-'.
05 R0-REPORT-NUMBER PIC X(2).
05 FILLER PIC X(18) VALUE SPACES.
05 R0-REPORT-TITLE PIC X(40>
05 FILLER PIC X(7) VALUE SPACES.
05 FILLER PIC X(6) VALUE 'PAGE '.
05 R0-PAGE-NUMBER PIC ZZZZ.
05 FILLER PIC X(6) VALUE SPACES.
05 R1-DATE PIC X(8).
05 FILLER PIC X(14) VALUE SPACES.
01 R0-HD1-LINE.
05 FILLER PIC X(400 VALUE SPACES.
05 R0-CUSTOMER PIC X(40) VALUE SPACES.
05 FILLER PIC X(52) VALUE SPACES.
01 AAM020-R4-HD2.
05 FILLER PIC X(35) VALUE SPACES.
05 FILLER PIC X(5) VALUE 'TITLE'.
05 FILLER PIC X(8) VALUE SPACES.
05 FILLER PIC X(7) VALUE 'ACCOUNT'.
05 FILLER PIC X(6) VALUE SPACES.
05 FILLER PIC X(9) VALUE 'REFERENCE'.
05 FILLER PIC X(36) VALUE SPACES.
05 FILLER PIC X(8) VALUE 'ACTIVE '.
05 FILLER PIC X(6) VALUE SPACES.
05 FILLER PIC X(6) VALUE 'OPENED'.
05 FILLER PIC X(10) VALUE ' CYCLE '.
01 AAM020-R4-HD1.
05 FILLER PIC X(30)
VALUE ' CUSTOMER - ID ACCOUNT '.
05 FILLER PIC X(5) VALUE SPACES.
05 FILLER PIC X(5) VALUE 'SHORT'.
05 FILLER PIC X(9) VALUE SPACES.
05 FILLER PIC X(7) VALUE 'RELATED'.
05 FILLER PIC X(5) VALUE SPACES.
05 FILLER PIC X(4) VALUE 'AREA'.
05 FILLER PIC X(12) VALUE SPACES.
05 FILLER PIC X(6) VALUE 'S.I.C.'.
05 FILLER PIC X(9) VALUE ' OFFICER'.
05 FILLER PIC X(5) VALUE SPACES.
05 FILLER PIC X(9) VALUE 'DEPT '.
05 FILLER PIC X(9) VALUE 'LAST DATE'.
05 FILLER PIC X(9) VALUE ' DATE'.
05 FILLER PIC X(3) VALUE SPACES.
05 FILLER PIC X(7) VALUE 'STMT '.
01 AAM020-R4-DTL1.
05 FILLER PIC X(2) VALUE SPACES.
05 R4-USER-ID PIC ZZZ.
05 FILLER PIC X VALUE SPACE.
05 R40-BRANCH PIC ZZ.
05 FILLER PIC X(3) VALUE SPACES.
05 R4-ACCT-APPL PIC X(2) VALUE SPACES.
05 R4-ACCT-NUMBER PIC ZZZ99B9999B9.
05 FILLER PIC X(3) VALUE SPACES.
05 R4-SHORT-TITLE PIC X(13).
05 FILLER PIC X VALUE SPACE.
05 R4-PARENT-NUBMER PIC ZZZ99B9999B9.
05 FILLER PIC X VALUE SPACE.
05 R4-AREA-REFERENCE PIC ZBZZZBZZZZZ.
05 FILLER PIC X(9) VALUE SPACES.
05 R4-S-I-C PIC ZZZZZ.
05 FILLER PIC X(4) VALUE SPACES.
05 R4-OFFICER-NUMBER PIC ZZZZZ.
05 FILLER PIC X(3) VALUE SPACES.
05 R4-DEPARTMENT PIC ZZZZZ.
05 FILLER PIC X(8) VALUE SPACES.
05 R4-LAST-ACTIVE PIC ZZBZZBZZ.
05 FILLLER PIC X(2) VALUE SPACES.
05 R4-DTE-OPENED PIC ZZBZZBZZ.
05 R4-STMT-CYCLE PIC ZZ.
05 FILLER PIC X(5) VALUE SPACES.
01 AAM020-R4-DTL2.
05 FILLER PIC X(9) VALUE SPACES.
05 R4-NET-INVESTIBLE PIC ZZZ,ZZZ,ZZZ,ZZ-.
05 FILLER PIC X VALUE SPACE.
05 R4-SERVICES PIC ZZZ,ZZZ,ZZZ,ZZ-.
05 FILLER PIC X VALUE SPACE.
05 R4-INVESTIBLE PIC ZZZ,ZZZ,ZZZ,ZZ-.
05 FILLER PIC X VALUE SPACE.
05 R4-COLLECTED PIC ZZZ,ZZZ,ZZZ-.
05 FILLER PIC X VALUE SPACE.
05 R4-AVG-LEDGER PIC ZZZ,ZZZ,ZZZ-.
05 FILLER PIC X(6) VALUE SPACES.
05 R4-DIVISION PIC X.
05 FILLER PIC X(8) VALUE SPACES.
05 R4-OD-FLAG PIC X(6).
05 FILLER PIC X(8) VALUE SPACES.
05 R4-ACCOUTN-TYPE PIC 9.
05 FILLER PIC X(5) VALUE SPACES.
05 R4-N-A-CODE PIC 9.
05 FILLER PIC X(5) VALUE SPACES.
05 R4-STMT-CD PIC 9.
05 FILLER PIC X(5) VALUE SPACES.
05 R4-CORR PIC ZZZ.
05 FILLER PIC X VALUE SPACE.
01 AAM020-R4-HD3.
05 FILLER PIC X(20) VALUE ' NET INVESTIBEL '.
05 FILLER PIC X(20) VALUE ' CURRENT SERVICE '.
05 FILLER PIC X(22) VALUE ' INVESTIBLE AVAERAGE'.
05 FILLER PIC X(7) VALUE 'AVERAGE'.
05 FILLER PIC X(10) VALUE SPACES.
05 FILLER PIC X(13) VALUE 'DIVISION OD'.
05 FILLER PIC X(9) VALUE SPACES.
05 FILLER PIC X(11) VALUE 'ACCT N/A '.
05 FILLER PIC X(12) VALUE ' STMT CORR'.
01 AAM020-R4-HD4.
05 FILLER PIC X(20) VALUE ' BALANCE'.
05 FILLER PIC X(20) VALUE ' CHARGES '.
05 FILLER PIC X(17) VALUE ' BALANCE '.
05 FILLER PIC X(9) VALUE 'COLLECTED'.
05 FILLER PIC X(9) VALUE SPACES.
05 FILLER PIC X(6) VALUE 'LEDGER'.
05 FILLER PIC X(17) VALUE SPACES.
05 FILLER PIC X(9) VALUE 'INDICATOR'.
05 FILLER PIC X(13) VALUE ' TYPE ORG '.
05 FILLER PIC X(12) VALUE ' CD '.
01 AAM020-R4-HD5.
05 FILLER PIC X(7) VALUE SPACES.
05 R4-CMMT-LINT PIC X(30).
05 FILLER PIC X(95) VALUE SPACES.
01 AAM020-R4-HD6.
05 FILLER PIC X(19) VALUE ' MONTH 1 '.
05 FILLER PIC X(19) VALUE ' MONTH 2 '.
05 FILLER PIC X(19 VALUE ' MONTH 3 '.
05 FILLER PIC X(19) VALUE ' MONTH 4 '.
05 FILLER PIC X(19) VALUE ' MONTH 5 '.
05 FILLER PIC X(19 VALUE ' MONTH 6 '.
05 FILLER PIC X(19) VALUE SPACES.
01 AAM020-R4-HD7.
05 FILLER PIC X(19) VALUE ' MONTH 7 '.
05 FILLER PIC X(19) VALUE ' MONTH 8 '.
05 FILLER PIC X(19 VALUE ' MONTH 9 '.
05 FILLER PIC X(19) VALUE ' MONTH 10 '.
05 FILLER PIC X(19) VALUE ' MONTH 11 '.
05 FILLER PIC X(19 VALUE ' MONTH 12 '.
05 FILLER PIC X(19) VALUE SPACES.
01 R4-COMMENT-LINES.
05 AVL PIC X(30) VALUE 'AVERAGE LEDGER BALANCES '.
05 ACB PIC X(30) VALUE 'AVERAGE COLLECTED BALANCES '.
05 ATB PIC X(30) VALUE 'AVERAGE INVESTIBLE BALANCES '.
05 IBR PIC X(30) VALUE 'INVESTIBLE BALANCES REQUIRED '.
05 SRV PIC X(30) VALUE 'SERVICE BALANCES '.
01 AAM020-R4-EDIT-PATTERNS.
05 PATTERN-TABLE.
10 ENTRY1.
15 FILLER PIC X(3) VALUE SPACES.
15 E1 PIC ZZ,ZZZ,ZZZ,ZZZ.
15 FILLER PIC X(2) VALUE SPACES.
10 E2.
15 FILLER PIC X(3) VALUE SPACES.
15 EP2 PIC ZZ,ZZZ,ZZZ,ZZZ.
15 FILLER PIC X(2) VALUE SPACES.
10 E3.
15 FILLER PIC X(3) VALUE SPACES.
15 EP3 PIC ZZ,ZZZ,ZZZ,ZZZ.
15 FILLER PIC X(2) VALUE SPACES.
10 E4.
15 FILLER PIC X(3) VALUE SPACES.
15 E1 PIC ZZ,ZZZ,ZZZ,ZZZ.
15 FILLER PIC X(2) VALUE SPACES.
10 E5.
15 FILLER PIC X(3) VALUE SPACES.
15 EP2 PIC ZZ,ZZZ,ZZZ,ZZZ.
15 FILLER PIC X(2) VALUE SPACES.
10 E6.
15 FILLER PIC X(3) VALUE SPACES.
15 EP3 PIC ZZ,ZZZ,ZZZ,ZZZ.
15 FILLER PIC X(2) VALUE SPACES.
05 EDIT-ENTRY REDEFINES PATTERN-TABLE,
OCCURS 6 TIMES INDEXED BY PATTRN-SUB.
10 FILLER PIC X(3) VALUE SPACES.
10 EP3 PIC ZZ,ZZZ,ZZZ,ZZZ.
10 FILLER PIC X(2) VALUE SPACES.
01 DDA-HISTORY-TRANS.
02 SEQINTRANS.
03 BNKT PIC X.
03 CTLT PIC X.
03 ACCTT PIC X(4).
02 DATAT PIC X(35).
02 ODT PIC X.
02 NSFT PIC X.
02 LEGT PIC S9(7) COMP-3.
02 COLT PIC S9(7) COMP-3.
02 PORLT PIC S9(7) COMP-3.
02 ACUMCST PIC S9(5)V99 COMP-3.
02 AMTSCT PIC X9(5)V9(2) COMP-3.
02 EARNST PIC S9(9) COMP-3.
02 NOCRT PIC S9(3) COMP-3.
02 AMTCRT PIC S9(9)V99 COMP-3.
02 NODBT PIC S9(5) COMP-3.
02 AMTDBT PIC S9(9)V99 COMP-3.
02 LOCDEPT PIC S9(7) COMP-3.
02 OTHDEPT PIC S9(7) COMP-3.
01 DDA-HISTORY-MASTER.
02 SEQOUT.
03 BNKO PIC X.
03 CTLO PIC X.
03 ACCTO PIC X(4).
02 AREA10.
03 DIVO PIC X.
03 OFF10 PIC X.
03 OFF20 PIC X.
03 SIGBALO PIC X.
03 TYPEO PIC X.
03 SICO PIC XX.
03 SHTNMEO PIC X(13).
03 RELACTO PIC X(4).
03 DATOPNO PIC XX.
03 STATO PIC X.
03 SUMMO PIC X.
03 SCACTO PIC X.
03 SCREVO PIC X.
03 SCFACO PIC X.
03 STMTCDO PIC X.
03 STMTCYO PIC XX.
03 ODPOINTO PIC X.
02 ODCO PIC X.
02 OD10 PIC X.
02 OD20 PIC X.
02 OD30 PIC X.
02 OD40 PIC X.
02 OD50 PIC X.
02 NSFCO PIC X.
02 NSF10 PIC X.
02 NSF20 PIC X.
02 NSF30 PIC X.
02 NSF40 PIC X.
02 NSF50 PIC X.
02 AVGLGRO OCCURS 13 TIMES PIC S9(7) COMP-3.
02 LGRYTDO PIC S9(9) COMP-3.
02 AVGCOLO OCCURS 13 TIMES PIC S9(7) COMP-3.
02 COLYTDO PIC S9(9) COMP-3.
02 PORLO OCCURS 13 TIMES PIC S9(7) COMP-3.
02 PORLYTDO PIC S9(9) COMP-3.
02 AVGFREO OCCURS 13 TIMES PIC S9(7) COMP-3.
02 FREYTDO PIC S9(9) COMP-3.
01 AAM020-R3-DTL-HDO.
05 FILLER PIC X(20) VALUE SPACES.
05 FILLER PIC X(12) VALUE 'T-BILL RATE='.
05 T-BILL-PR PIC ZZZ99.9999.
05 FILLER PIC X VALUE '%'.
05 FILLER PIC X(5) VALUE SPACES.
05 FILLER PIC X(13) VALUE 'PROCESS DATE='.
05 R3-DATE-PR PIC Z9B99B99.
05 FILLER PIC X(5) VALUE SPACES.
05 FILLER PIC X(13) VALUE 'RESERVE RATE='.
05 RSV-PR PIC ZZZ99.9999.
05 FILLER PIC X VALUE '%'.
01 AAM020-R3-DTL-HD1.
05 FILLER PIC X(2) VALUE SPACES.
05 FILLER PIC X(13) VALUE 'CUSTOMER - ID'.
05 FILLER PIC X(11) VALUE ' ACCOUNT'.
05 FILLER PIC X(11) VALUE ' SHORT'.
05 FILLER PIC X(9) VALUE SPACES.
05 FILLER PIC X(7) VALUE 'REALATED'.
05 FILLER PIC X(79) VALUE SPACES.
01 AAM020-R3-DTL-HD2.
05 FILLER PIC X(35) VALUE SPACES.
05 FILLER PIC X(5) VALUE 'TITLE'.
05 FILLER PIC X(8) VALUE SPACES.
05 FILLER PIC X(7) VALUE 'ACCOUNT'.
05 FILLER PIC X(77) VALUE SPACES.
01 AAM020-R3-DTL1.
05 FILLER PIC X(8) VALUE SPACES.
05 R3-USER-ID PIC ZZZ.
05 FILLER PIC X VALUE SPACE.
05 R3-BRANCH PIC ZZ.
05 R3-ACCT-NUMBER PIC ZZZ99B9999B9.
05 FILLER PIC X(3) VALUE SPACES.
05 R3-SHORT PIC X(13).
05 R3-RLTD-NUMBER PIC ZZZ99B9999B9.
01 AAM020-R3-DTL-HD3.
05 FILLER PIC X(20) VALUE SPACES.
05 FILLER PIC X(13) VALUE 'TX-CODE SEQ'.
05 FILLER PIC X(12) VALUE SPACES.
05 FILLER PIC X(30)
VALUE ' TRANSACTION DESCRIPTION '.
05 FILLER PIC X(15) VALUE SPACES.
05 FILLER PIC X(11) VALUE 'UNIT AMOUNT'.
05 FILLER PIC X(11) VALUE SPACES.
05 FILLER PIC X(10) VALUE 'NET CHARGE'.
05 FILLER PIC X(10) VALUE SPACES.
01 AAM020-R3-DTL2.
03 R3-SPACE1.
05 FILLER PIC X(20) VALUE SPACES.
05 T3-TAN-CODE PIC ZZBZZZ.
05 FILLER PIC X(4) VALUE SPACES.
05 R3-SEQ PIC ZZZZZ.
05 FILLER PIC X(10) VALUE SPACES.
03 R3-DSC.
05 R3-TX-DESC PIC X(30).
03 R3-SPACE2.
05 FILLER PIC X(9) VALUE SPACES.
05 R3-UNITS PIC ZZZ,ZZZ,ZZZ.ZZZZ-.
05 FILLER PIC X(6) VALUE SPACES.
05 R3-NET-CHARGE PIC ZZZ,ZZZ,ZZZ.ZZZZ-.
05 FILLER PIC X(8) VALUE SPACES.
01 AAM020-R3-RCP.
05 FILLER PIC X(8) VALUE SPACES.
05 FILLER PIC X(24)
VALUE 'NUMBER OF TRANSACTIONS '.
05 R3-TX-TOTAL PIC ZZ,ZZZ,ZZZ.
05 FILLER PIC X(28)
VALUE ' TOTAL SERVICE CHARGE '.
05 R3-TOTAL-CHG PIC ZZ,ZZZ,ZZZ,ZZZ.ZZZZ-.
05 FILLER PIC X(13) VALUE ' TOTAL UNITS'.
05 FILLER PIC X(3) VALUE SPACES.
05 R3-TOTAL-UNITS PIC ZZ,ZZZ,ZZZ,ZZZ.ZZZZ.
05 FILLER PIC X(7) VALUE SPACES.
01 AAM020-R2-DTL2.
05 FILLER PIC X(20) VALUE SPACES.
05 R2D2-NUM-CR PIC ZZ,ZZ9.
05 FILLER PIC X(3) VALUE SPACES.
05 R202-AMT-CR PIC ZZZ,ZZZ,ZZZ.99.
05 FILLER PIC X(3) VALUE SPACES.
05 R202-NUM-DB PIC ZZ,ZZ9.
05 FILLER PIC X(3) VALUE SPACES.
05 R2D2-AMT-DB PIC ZZZ,ZZZ,ZZZ.99.
05 FILLER PIC X(63) VALUE SPACES.
01 AAM020-R2-DTL1.
05 R2D1-ACCT-NUMBER PIC ZZZ99B9999B9.
05 FILLER PIC X VALUE SPACE.
05 R2D1-SHORT-TITEL PIC X(13).
05 FILLER PIC X(2) VALUE SPACES.
05 R2D1-EARN-BAL PIC ZZZ,ZZZ,ZZZ-.
05 FILLER PIC X VALUE SPACE.
05 R2D1-COLLECTED PIC Z,ZZZ,ZZZ-.
05 FILLER PIC X VALUE SPACE.
05 R2D1-LEDGER PIC Z,ZZZ,ZZZ-.
05 FILLER PIC X(6) VALUE SPACES.
05 R2D1-STMT-CYCLE PIC XX.
05 FILLER PIC X(3) VALUE SPACES.
05 R2D1-SERV-CHRG PIC ZZZ,ZZ9.99-.
05 FILLER PIC X VALUE SPACE.
05 R2D1-TIMES-OD PIC Z,ZZZ.
05 FILLER PIC X(2) VALUE SPACES.
05 R2D1-TIMES-NSF PIC Z,ZZZ.
05 FILLER PIC X(4) VALUE SPACES.
05 R2D1-LOCAL-ITEMS PIC Z,ZZZ,ZZZ.
05 FILLER PIC X(2) VALUE SPACES.
05 R2D1-OTHER-ITEMS PIC Z,ZZZ,ZZZ.
05 FILLER PIC X(3) VALUE SPACES.
05 R2D1-FAC-CODE PIC X.
05 FILLER PIC X VALUE '-'.
05 R2D1-WAVE-CODE PIC X.
01 AAM020-R2-DTL-HD3.
05 FILLER PIC X(27) VALUE PSACES.
05 FILLER PIC X(7) VALUE 'CREDITS'.
05 FILLER PIC X(19) VALUE SPACES.
05 FILLER PIC X(6) VALUE 'DEBITS'.
05 FILLER PIC X(73) VALUE SPACES.
01 AAM020-R2-DTL-HD4.
05 FILLER PIC X(20) VALUE SPACES.
05 FILLER PIC X(18) VALUE 'NUMBER AMOUNT'.
05 FILLER PIC X(8) VALUE SPACES.
05 FILLER PIC X(18) VALUE 'NUMBER AMOUNT'.
05 FILLER PIC X(68) VALUE SPACES.
01 AAM020-R2-DTL-HD2.
05 FILLER PIC X(8) VALUE ' NUMBER'.
05 FILLER PIC X(7) VALUE SPACES.
05 FILLER PIC X(5) VALUE 'TITLE'.
05 FILLER PIC X(11) VALEU SPACES.
05 FILLER PIC X(7) VALUE 'BALANCE'.
05 FILLER PIC X(6) VALUE SPACES.
05 FILLER PIC X(9) VALUE 'COLLECTED'.
05 FILLER PIC X(4) VALUE SPACES.
05 FILLER PIC X(14) VALUE ' LEDGER CYCLE'
05 FILLER PIC X(17) VALUE ' CHARGE OD'.
05 FILLER PIC X(7) VALUE ' NSF'.
05 FILLER PIC X(7) VALUE SPACES.
05 FILLER PIC X(16)
VALUE 'LOCAL OTHER'.
05 FILLER PIC X(6) VALUE SPACES.
05 FILLER PIC X(4) VALUE 'CODE'.
05 FILLER PIC X(4) VALUE SPACES.
01 AAM020-R2-DTL-HD1.
05 FILLER PIC X(17)
VALUE ' ACCOUNT SHORT'.
05 FILLER PIC X(9) VALUE SPACES.
05 FILLER PIC X(9) VALUE 'EARNINGS'.
05 FILLER PIC X(7) VALUE SPACES.
05 FILLER PIC X(7) VALUE 'AVERAGE'.
05 FILLER PIC X(6) VALUE SPACES.
05 FILLER PIC X(7) VALUE ' AVERAGE'.
05 FILLER PIC X(4) VALUE SPACES.
05 FILLER PIC X(4) VALUE 'STMT'.
05 FILLER PIC X(3) VALUE SPACES.
05 FILLER PIC X(7) VALUE 'SERVICE'.
05 FILLER PIC X(4) VALUE SPACES.
05 FILLER PIC X(5) VALUE 'TIMES'.
05 FILLER PIC X(7) VALUE ' TIMES'.
05 FILLER PIC X(5) VALUE SPACES.
05 FILLER PIC X(5) VALUE 'ITEMS'.
05 FILLER PIC X(11) VALUE ' DEPOSITED'.
05 FILLER PIC X(6) VALUE SPACES.
05 FILLER PIC X(5) VALUE 'WAIVE'.
05 FILLER PIC X(4) VALUE SPACES.
01 AAM020-R1-DTL-HEAD.
05 FILLER PIC X(30)
VALUE ' ACCOUNT NUMBER SHORT NAME'.
05 FILLER PIC X(9) VALUE SPACES.
05 FILLER PIC X(13)
VALUE 'FIELD CHANGED'.
05 FILLER PIC X(17) VALUE SPACES.
05 FILLER PIC X(4) VALUE 'FROM'.
05 FILLER PIC X(35) VALUE SPACES.
05 FILLER PIC X(2) VALUE 'TO'.
05 FILLER PIC X(21) VALUE SPACES.
01 AAM020-R1-DTL-LINE.
05 FILLER PIC X VALUE SPACE.
05 R1-ACCT-APPL-CODE PIC XX VALUE SPACES.
05 R1-ACCT-NUMBER PIC ZZZ99B9999B9.
05 FILLER PIC X(5) VALUE SPACES.
05 R1-SHORT-TITLE PIC X(13).
05 FILLER PIC X(4) VALUE SPACES.
05 R1-FIELD-FROM PIC X(14) VALUE PSACES.
05 FILLER PIC X(4) VALUE SPACES.
05 R1-FIELS-DESC PIC X(30) VALUE SPACES.
05 FILLER PIC X(4) VALUE SPACES.
05 R1-FIELD-TO PIC X(14) VALUE SPACES.
05 FILLER PIC X(4) VALUE SPACES.
01 AAM020-R5-HD1.
05 FILLER PIC X(20) VALUE ' ACCOUNT NUMBER '.
05 FILLER PIC X(20) VALUE ' SHORT TITLE '.
05 FILLER PIC X(20 VALUE ' LAST ACTIVE RE'.
05 FILLER PIC X(20) VALUE 'LATED ACCOUNT '.
05 FILLER PIC X(52) VALUE SPACES.
01 AAM020-R5-DTL.
05 R5-APPL-CODE PIC X(2).
05 FILLER PIC X(2) VALUE SPACES.
05 R5-ACCT-NUMBER PIC ZZZ99B9999B9.
05 FILLER PIC X(10) VALUE SPACES.
05 R5-SHORT-TITLE PIC X(13).
05 FILLER PIC X(6).
05 R5-LAST-ACTIVE PIC 99B99B99.
05 FILLER PIC X(8) VALUE SPACES.
05 R5-PARENT-APPL PIC X(2).
05 FILLER PIC X VALUE SPACE.
05 R5-PARENT-NUMB PIC ZZZ99B9999B9.
05 FILLER PIC X(57) VALUE SPACES.
01 AAM020-R6-HD.
05 FILLER PIC X(10) VALUE SPACES.
05 FILLER PIC X(22) VALUE 'ACCOUNT IDENTIFICATION'.
05 FILLER PIC X(4) VALUE SPACES.
05 FILLER PIC X(14) VALUE 'SERIAL NUMBER '.
05 FILLER PIC X(11) VALUE ' TRAN CODE'.
05 FILLER PIC X(24) VALUE SPACES.
05 FILLER PIC X(15) VALUE 'REJECT MESSAGE'.
05 FILLER PIC X(33) VALUE SPACES.
01 AAM020-R6-DTL.
05 FILLER PIC X(110 VALUE SPACES.
05 R6-APPL PIC X(2).
05 FILLER PIC X(2) VALUE SPACES.
05 R6-ACCOUNT PIC ZZZB99B9999B9.
05 FILLER PIC X(11) VALUE SPACES.
05 R6-SERNUM PIC ZZZZZ.
05 FILLER PIC X(10) VALUE SPACES.
05 R6-TRAN PIC ZZBZZZ.
05 FILLER PIC X(10) VALUE SPACES.
05 R6-MSG PIC X(40) VALUE SPACES.
05 FILLER PIC X(22) VALUE SPACES.
01 REPORT-TITLE-TABLE.
05 RPT-TIT.
10 R1 PIC X(36)
VALUE 'ACCOUNT ANALYSIS MAINTENANCE LIST '.
10 R2 PIC X(36)
VALUE 'ACCOUNT ANALYSIS DDA EXTRACT MAIN '.
10 R3 PIC X(36)
VALUE 'ACCOUNT ANALYSIS TRANSACTION JOURNAL'.
10 R4 PIC X(36)
VALUE 'ACCOUNT-ANALYSIS MASTER RECORD PRINT'.
10 R5 PIC X(36)
VALUE 'ACCOUNT ANALYSIS DORMANT ACCOUNTS '.
10 R6 PIC X(36)
VALUE ' ACCOUNT ANALYSIS POSTING REJECTS '.
10 R7 PIC X(36)
VALUE 'ACCOUNT ANALYSIS ** UNUSED ** '.
05 REPORT-TITLE REDEFINES RPT-TIT PIC X(36)
OCCURS 7 TIMES.
01 REPORT-NUMBER-TABLE.
05 RPT-NUM-TAB.
10 RN1 PIC X(2) VALUE 'R1'.
10 RN2 PIC X(2) VALUE 'R2'.
10 RN3 PIC X(2) VALUE 'R3'.
10 RN4 PIC X(2) VALUE 'R4'.
10 RN5 PIC X(2) VALUE 'R5'.
10 RN6 PIC X(2) VALUE 'R6'.
10 RN7 PIC X(2) VALUE 'R7'.
05 REPORT NUMBER REDEFINES RPT-NUM-TAB PIC X(2)
OCCURS 7 TIMES.
01 REPORT-CONTROL-TABLE.
05 REPORT-TABLE OCCURS 7 TIMES
INDEXED BY REPORT-SUB.
10 REPORT-CODES PIC 9(5) COMP-3.
10 PAGE-COUNT PIC 9(5) COMP-3.
10 LINE-COUNT PIC 9(5) COMP-3.
10 SPACING PIC X.
10 REPORT-LINE PIC X(132).
01 SPOOL-REPORT-RECORD.
05 SPOOL-CODES PIC 9(5) COMP-3.
05 SPOOL-PAGE PIC 9(5) COMP-3.
05 SPOOL-LINES PIC 9(5) COMP-3.
05 SPOOL-IMAGE PIC X(133).
01 CUSTOMER-BRANCH-TABLE.
02 CUST-TABLE OCCURS 10 TIMES,
ASCENDING KEY IS CUST-NUMB
INDEXED BY CUST-SUB.
04 CUST-NUMB PIC 9(3) COMP-3.
04 CUST-NAME PIC X(40).
04 NUMB-OF-BRANCHES PIC 99 COMP-3.
04 BRANCH OCCURS 10 TIMES
ASCENDING KEY IS BRANCH-NUMB
INDEXED BY BRANCH-SUB.
05 BRANCH-NUMB PIC 99 COMP-3.
05 BRANCH-DESC PIC X(40).
01 DIVISION-DEPARTMENT-XREF-TABLE.
05 DVTB.
10 D1 PIC X VALUE 'A'.
10 V1 PIC 9(5) COMP-3 VALUE ZEROS.
10 D2 PIC X VALUE 'B'.
10 V2 PIC 9(5) COMP-3 VALUE ZEROS.
10 D3 PIC X VALUE 'C'.
10 V3 PIC 9(5) COMP-3 VALUE 00630.
10 D4 PIC X VALUE 'D'.
10 V4 PIC 9(5) COMP-3 VALUE 00614.
10 D5 PIC X VALUE 'E'.
10 V5 PIC 9(5) COMP-3 VALUE 00000.
10 D6 PIC X VALUE 'F'.
10 V6 PIC 9(5) COMP-3 VALUE 00000.
10 D7 PIC X VALUE 'G'.
10 V7 PIC 9(5) COMP-3 VALUE 00615.
10 D8 PIC X VALUE 'H'.
10 V8 PIC 9(5) COMP-3 VALUE 00661.
10 D9 PIC X VALUE 'I'.
10 V9 PIC 9(5) COMP-3 VALUE 00650.
10 D10 PIC X VALUE 'M'.
10 V10 PIC 9(5) COMP-3 VALUE 00610.
10 D11 PIC X VALUE 'N'.
10 V11 PIC 9(5) COMP-3 VALUE 00620.
10 D12 PIC X VALUE 'P'.
10 V12 PIC 9(5) COMP-3 VALUE 00640.
10 D13 PIC X VALUE 'R'.
10 V13 PIC 9(5) COMP-3 VALUE 00660.
10 D14 PIC X VALUE 'X'.
10 V14 PIC 9(5) COMP-3 VALUE 00611.
10 D15 PIC X VALUE 'Y'.
10 V15 PIC 9(5) COMP-3 VALUE 00630.
10 D16 PIC X VALUE 'Z'.
10 V16 PIC 9(5) COMP-3 VALUE 00000.
05 DIVISION-DEPT-TABLE REDEFINES DVTB
OCCURS 16 TIMES,
INDEXED BY DIVTAB-SUB.
10 DIV PIC X.
10 DEPT PIC 9(5) COMP-3.
01 REJECT-MSEEAGE-TABLE.
05 RMT.
10 M01 PIC X(34)
VALUE 'NO MATCHING ACCOUNT ON FILE '.
10 M02 PIC X(34)
VALUE 'TRANSACTION NOT IN RATE FILE '.
10 M03 PIC X(34)
VALUE 'T-BILL RATE NOT LOADED RUN ABORTED '.
10 M04 PIC X(34)
VALUE 'T-BILL RATE ZERO *** RUN ABORTED '.
10 M05 PIC X(34)
VALUE 'RESERVE RATE ZERO *** RUN ABORTED '.
10 M06 PIC X(34)
VALUE 'ACCOUNT ON FILE -- SETUP REJECTED '.
10 M07 PIC X(34)
VALUE 'DORMANT ACCOUNT-ACTIVITY REJECTED '.
10 M08 PIC X(34)
VALUE 'FILE MAINT FIELD IS NOT NUMERIC '.
10 M09 PIC X(34)
VALUE 'INVALID HISOTRY CHANGE FIELD '.
10 M10 PIC X(34)
VALUE 'INVALID MAINTENANCE TRANSCTION '.
10 M011 PIC X(34)
VALUE 'NO MATCHING ACCOUNT ON FILE '.
10 M012 PIC X(34)
VALUE 'NO MATCHING ACCOUNT ON FILE '.
10 M013 PIC X(34)
VALUE 'NO MATCHING ACCOUNT ON FILE '.
10 M014 PIC X(34)
VALUE 'NO MATCHING ACCOUNT ON FILE '.
10 M015 PIC X(34)
VALUE 'NO MATCHING ACCOUNT ON FILE '.
05 REJECT-REASONS REDEFINES RMT PIC X(34),
OCCURS 15 TIMES,
INDEXED BY RMT-SUB.
05 REJECT-ERRORS PIC 99 COMP-3,
OCCURS 15 TIMES,
INDEXED BY REJ-SUB.
01 FM-TABLE-DESCRIPTIONS.
05 FM-TAB.
10 FM1 PIC X(30)
VALUE 'CHANGE SHORT NAME TO '.
10 FM2 PIC X(30)
VALUE 'CHANGE AREA REFERENCT TO '.
10 FM3 PIC X(30)
VALUE 'CHANGE S. I. C. TO '.
10 FM4 PIC X(30)
VALUE 'CHANGE OFFICER CODE TO '.
10 FM5 PIC X(30)
VALUE 'CHANGE DEPARTMENT CODE TO '.
10 FM6 PIC X(30)
VALUE 'CHANGE DDA CYCLE CODE TO '.
10 FM7 PIC X(30)
VALUE 'CHANGE O/D LIMIT CODE TO '.
10 FM8 PIC X(30)
VALUE 'CVHANGE REQUEST MASTER RECORD '.
10 FM9 PIC X(30)
VALUE 'CHANGE N/A FLAG TO '.
10 FM10 PIC X(30)
VALUE 'CHANGE STATEMENT FLAG TO '.
10 FM11 PIC X(30)
VALUE 'CHANGE CB REGION TO '.
10 FM12 PIC X(30)
VALUE 'CHANGE DATE LAST ACTIVE TO '.
10 FM13 PIC X(30)
VALUE 'CHANGE STATEMENT BALANCE TO '.
10 FM14 PIC X(30)
VALUE 'CHANGE AVERAGE LEDGER TO '.
10 FM15 PIC X(30)
VALUE 'CHANGE INVESTIBLE BALANCE TO '.
10 FM16 PIC X(30)
VALUE 'CHANGE INVESTIBLE REQUIRED TO '.
10 FM17 PIC X(30)
VALUE 'CHANGE COLLECTED BALANCE TO '.
10 FM18 PIC X(30)
VALUE 'CHANGE SERVICE BALANCE TO '.
10 FM19 PIC X(30)
VALUE 'CHANGE INVESTIBLE HISTORY TO '.
10 FM20 PIC X(30)
VALUE 'CHANGE SERVICE HISTORY TO '.
10 FM21 PIC X(30)
VALUE 'CHANGE INVESTIBLE REQ HISTORY '.
10 FM22 PIC X(30)
VALUE 'DELETE ACCOUNT -MAKE DORMANT- '.
10 FM23 PIC X(30)
VALUE 'NEW ACCOUNT SETUP '.
10 FM24 PIC X(30)
VALUE 'REACTIVATE DORMANT ACCOUNT '.
10 FM25 PIC X(30)
VALUE 'CHANGE PARENT ACCOUNT NUMBER '.
05 FM-DESC-TABLE REDEFINES FM-TAB PIC X(30)
OCCURS 25 TIMES
INDEXED BY FM-DESC-SUB.
01 CURRENT-DATE-SAVE.
02 CURR-MO PIC 99.
02 FILLER PIC X.
02 CURR-DA PIC 99.
02 FILLER PIC X.
02 CUR-YR PIC 99.
01 DATE-WORD-AREAS.
02 PD-DATE.
03 PD-YR PIC 99.
03 PD-MO PIC 99.
03 PD-DA PIC 99.
02 PACK-DATE REDEFINES PD-DATE PIC 9(6).
02 PACKED-DATE-YMD-CURR PIC 9(6) COMP-3.
02 CURR-PACKED-DATE-MDY PIC 9(6) COMP-3.
02 PROCESS-DATE-YMD PIC 9(6) COMP-3 VALUE ZEROS.
02 CONVERT-NUMB.
05 NUM-2-WRK PIC X(2).
05 NUM2 REDEFINES NUMB-2-WRK PIC 9(2).
02 CNTRL-BREAK-CONVERT.
05 HEX-7F PIC 9 COMP-3 VALUE 7.
05 CHAR-7F REDEFINES HEX-7F PIC X.
01 BINARY-ACCOUNT-CONVERT SYNC.
05 BINARY-DDA-ACCOUNT PIC X(4).
05 DDA-ACCOUNT REDEFINES BINARY-DDA-ACCOUNT
PIC S9(7) COMP.
05 CNTRL-GROUP-CHECK REDEFINES DDA-ACCOUNT.
10 FIRST-POSITION PIC X.
10 FILLER PIC X(3).
01 BINARY-BANK-CONVERT SYNC.
05 BANK-NUMBER-DDA PIC S9(2) COMP.
05 CVD-BANK REDEFINES BANK-NUMBER-DDA.
10 BYTE1 PIC X.
10 BINARY-BANK PIC X.
01 BINARY-BYTE-CONVERT SYNC.
05 BINARY-NUMBER-1 PIC S9(3) COMP.
05 CVD-AREA-1 REDEFINES BINARY-NUMBER-1.
10 FILLER PIC X.
10 BINARY-BYTE PIC X.
01 TWO-BYTE-BINARY-CONVERT SYNC.
05 BINARY-NUMBER-2 PIC S9(5) COMP.
10 FILLER PIC X(2).
10 TWO-BINARY-BYTES PIC X(2).
01 RF-KEY.
05 RF-USER-ID PIC 9(3) COMP-3.
05 RF-TRAN-CODE PIC 9(5) COMP-3.
01 ACCESS-METHOD-CODES.
02 START-PROCESSING PIC 99 VALUE 00 COMP-3 .
02 READ-SEQ PIC 99 VALUE 01 COMP-3
02 WIRTE-SEQ PIC 99 VALUE 02 COMP-3.
02 OPEN-FILE-IN PIC 99 VALUE 03 COMP-3.
02 CLOSE-FILE PIC 99 VALUE 04 COMP-3.
02 OPEN-FILE-OUT PIC 99 VALUE 05 COMP-3.
02 READ-RANDOM PIC 99 VALUE 06 COMP-3.
02 WRITE-RANDOM PIC 99 VALUE 07 COMP-3.
02 RE-WRITE PIC 99 VALUE 08 COMP-3.
02 SETL PIC 99 VALUE 09 COMP-3.
02 ESETL PIC 99 VALUE 10 COMP-3.
02 OPEN-IO PIC 99 VALUE 11 COMP-3.
02 END-OF-JOB PIC 99 VALUE 99 COMP-3.
02 SPACE-ONE PIC X VALUE ' '.
02 SPACE-TWO PIC X VALUE '0'.
02 SPACE-THREE PIC X VALUE '-'.
02 SPACE-TOP PIC X VALUE '1'.
01 VARIOUS-STATUS-CODES.
02 IO-RETURN PIC 9(4) VALUE ZEROS COMP-3.
88 GOOD-RETURN VALUE ZEROS.
88 END-OF-FILE VALUE 1.
88 DUPLICATE-KEY VALUE 2.
88 NO-REC-FOUND VALUE 3.
88 OUT-OF-SEQUENCE VALUE 4.
88 INVALID-ENTRY VALUE 5.
88 FILES-LEFT-OPEN VALUE 6.
02 SRT PIC 9 VALUE ZERO.
88 GOOD-REC VALUE 0.
88 END-OF-INPUT-PHASE VALUE 9.
02 CUSTOMER-FLAG PIC 9 VALUE ZERO.
88 CUSTOMER-FOUND VALUE 1.
02 CHECK-DIGIT-RETURN PIC 9(3) VALUE ZEROS COMP-3.
88 SELF-CHECKS VALUE ZERO.
02 CUSTOMER-FLAG PIC 9 VALUE ZERO.
88 CUSTOMER-FOUND VALUE 1.
02 TRAN-CODE-BREAK PIC 9(5) COMP-3 VALUE ZEROS.
88 DELETE-ACCOUNT VALUE 10
88 NEW-ACCOUNT-SETUP VALUE 20.
88 RE-ACTIVATE-ACCOUNT VALUE 30.
88 CHANGE-PARENT-ACCOUNT VALUE 40.
02 MSTR-SV-FLAG PIC 9 COMP-3 VALUE ZERO.
88 MASTER-SAVED VALUE 1.
01 DDA-FLAGS.
02 DDA-HISTORY-FLAG PIC 99 COMP-3 VALUE ZEROS.
88 DDA-HISTORY-MISSING VALUE 1.
02 DDA-TRAN-FLAG PIC 99 COMP-3 VALUE ZEROS.
88 DDA-TRAN-MISSING VALUE 1.
02 FILE-STATUS-CODES.
05 AAMI-STATUS PIC 9(4) COMP-3 VALUE ZEROS.
88 AAMI-EOF VALUE 1.
05 DD-TRANS-STATUS PIC 9(4) COMP-3 VALUE ZEROS.
88 DDTR-EOF VALUE 1.
05 DD-HIST-STATUS PIC 9(4) COMP-3 VALUE ZEROS.
88 DDHST-EOF VALUE 1.
05 ATWR-STATUS PIC 9(4) COMP-3 VALUE ZEROS.
88 ATWR-EOF VALUE 1.
01 WS-PREV-FIELDS.
05 PREV-CUSTOMER PIC X(4).
05 PR-CUST REDEFINES PREV-CUSTOMER.
10 PREV-USER-ID PIC 9(3) COMP-3.
10 PREV-BRANCH PIC 9(2) COMP-3.
05 PREV-ACCOUNT-ID PIC X(9).
05 PR-ACT-ID REDEFINES PREV-ACCOUNT-ID.
10 PREV-ACCT-APPL-CODE PIC X(2).
10 PREV-ACCT-CHK-DIGIT PIC 9 COMP-3.
10 PREV-ACCT-NUMBER PIC 9(10) COMP-3.
PROCEDURE DIVISION.
HOUSKEEPING SECTION.
MOVE CURRENT-DATE TO R1-DATE, CURRENT-DATE-SAVE.
MOVE LOW-VALUES TO SEQINTRANS.
MOVE SPACES TO AAM020-R5-DTL.
MOVE LOW-VALUES TO SEQOUT.
MOVE HIGH-VALUES TO AAM-CUSTOMER.
MOVE HIGH-VALUES TO AAM-ACCOUNT-ID.
MOVE ZEROS TO PREV-USER-ID.
MOVE ZEROS TO PREV-BRANCH.
MOVE ZEROS TO PREV-ACCT-CHK-DIGIT.
MOVE ZEROS TO PREV-ACCT-NUMBER.
MOVE SPACES TO PREV-ACCT-APPL-CODE.
MOVE CURR-MO TO PD-MO.
MOVE CURR-DA TO PD-DA.
MOVE CURR-YR TO PD-YR.
MOVE PACK-DATE TO PACKED-DATE-YMD-CURR.
MOVE CURR-MO TO PD-YR.
MOVE CURR-YR TO PD-DA.
MOVE CURR-DA TO PD-MO.
MOVE PACK-DATE TO CURR-PACKED-DATE-MDY.
MOVE +1 TO SRT.
CALL 'IOWORKER' USING IO-RETURN, START-PROCESSING.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
MOVE 0990 TO RETURN-CODE,
GOBACK.
BACKUP-RATE-FILE.
CALL 'RATETAPE' USING IO-RETURN OPEN-FILE-OUT.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'SEQRATE' USING IO-RETURN OPEN-FILE-IN.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
READ-WRITE-RATEFILE.
CALL 'SEQRATE' USINT IO-RETURN, READ-SEQ, AA-SERVICE-MASTER.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
IF END-OF-FILE
GO TO CLOSE-SEQ-RATE.
CALL 'RATETAPE' USING IO-RETURN, WRITE-SEQ, AA-SERVICE-MASTER.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
GO TO READ-WRITE-RATEFILE.
CLOSE-SEQ-RATE.
CALL 'SEQRATE' USING IO-RETURN, CLOSE-FILE.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'RATETAPE' USING IO-RETURN, CLOSE-FILE.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'CUSTAB' USING IO-RETURN, OPEN-FILE-IN.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
SET CUST-SUB TO CUST-COUNT.
LOAD-CUSTOMER-DECRIPTIONS.
RETRIEVE-CUST-REC.
IF CUST-COUNT IS GREATER THAN 9,
OR IF BRANCH-COUNT IS GREATER THAN 9,
GO TO CLOSE-CUST-FILE.
CALL 'CUSTTAB' USING IO-RETURN, READ-SEQ, AA-CUSTOMER-DESCRIPTION.
IF END-OF-FILE TO TO CLOSE-CUST-FILE.
IF NOT GOOD-RETURN PERFORM DETERMINE-ERROR, GOBACK.
IF AACD-USER-ID IS NOT EQUAL TO PREV-AACD-USER-ID,
SET CUST-SUB UP BY +1,
ADD 1 TO CUST-COUNT,
SET BRANCH-SUB TO 1,
MOVE +1 TO BRANCH-COUNT,
MOVE AACD-USER-ID TO PREV-AACD-USER-ID, CUST-NUMB
OF CUST-TABLE (CUST-SUB),
MOVE AACD-DESCRIPTION TO CUST-NAME OF CUST-TABLE (CUST-SUB),
GO TO RETRIEVE-CUST-REC.
MOVE AACD-BRANCH TO BRANCH-NUMB
OF BRANCH (CUST-SUB, BRANCH-SUB).
MOVE AACD-DESCRIPTION TO BRANCH-DESC
OF BRANCH (CUST-SUB, BRANCH-SUB).
MOVE BRANCH-COUNT TO NUMB-OF-BRANCHES
OF CUST-TABLE (CUST-SUB).
SET BRANCH-SUB UP BY +1, ADD +1 TO BRANCH-COUNT.
GO TO RETRIEVE-CUST-REC.
CLOSE-CUST-FILE.
MOVE CUST-COUNT TO TABLE-LIMIT.
CALL'CUSTAB' USING IO-RETURN, CLOSE-FILE.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
LOAD-CUSTOMER-DESC-EXIT.
EXIT.
INITIALIZE-REPORT-TABLE.
SET REPORT-SUB TO 1.
MOVE 1 TO MISC-COUNTER.
CONTINUE-RPT-INIT.
MOVE MISC-COUNTER TO REPORT-CODES
OF REPORT-TABLE (REPORT-SUB).
MOVE ZEROS TO PAGE-COUNT
OF REPORT-TABLE (REPORT-SUB).
MOVE 99 TO LINE-COUNT
OF REPORT-TABLE (REPORT-SUB).
MOVE '1' TO SPACING
OF REPORT TABLE (REPORT-SUB).
MOVE SPACES TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
SET REPORT-SUB UP BY 1.
ADD 1 TO MISC-COUNTER.
IF MISC-COUNTER IS NOT GREATER THAN 7,
GO TO CONTINUE-RPT-INIT.
ZERO-REJECT-TABLE.
MOVE 1 TO MISC-COUNTER.
SET REJ-SUB TO 1.
ZERO-REJ-TAB.
MOVE ZEROS TO REJECT-ERRORS (REJ-SUB).
ADD 1 TO MISC-COUNTER.
IF MISC-COUNTER IS NOT GREATER THAN 15,
SET REJ-SUB UP BY 1,
GO TO ZERO-REJ-TAB.
SET REJ-SUB TO 1.
OPEN-ALL-FILES.
CALL 'RANDRATE' USING IO-RETURN, OPEN-FILE-IN.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'DDTRAN' USING IO-RETURN, OPEN-FILE-IN.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL'DDHIST' USING IO-RETURN, OPEN-FILE-IN.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'TRANWRK' USING IO-RETURN, OPEN-FILE-IN.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'AAHISTO' USING IO-RETURN, OPEN-FILE-OUT.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'RPTWTR' USING IO-RETURN, OPEN-FILE-OUT.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'AAMRECI' USING IO-RETURN, OPEN-FILE-IN.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'AAMRECO' USING IO-RETURN, OPEN-FILE-OUT.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
OPEN-FILES-EXIT.
EXIT.
FIRST-FILE-READS.
PERFORM ALL-FILE-READS THRU RTI-EXIT.
MOVE ATWR-USER-ID TO SEARCH-USER-ID.
MOVE ATWR-BRANCH TO SEARCH-BRANCH.
PERFORM CUSTOMER-SEARCH THRU CUSTOMER-SRC-EXIT.
PICK-UP-RATE-CONTROL.
IF ATWR-TRAN-CODE IS NOT EQUAL TO ZEROS,
MOVE 3 TO REJECT-ERRORS (3),
PERFORM TRANSACTION-ERROR-CHECK THRU TEC-EXIT,
MOVE ATWR-ACCOUNT-ID TO PREV-ACCOUNT-ID,
DISPLAY 'NO RATE CONTROLS -- STOP RUN',
GOBACK.
MOVE ATWR-UNITS OT T-BILL-RATE.
IF T-BILL-RATE IS EQUAL TO ZEROS,
MOVE 4 TO REJECT-ERRORS (4),
PERFORM TRANSACTION-ERROR-CHECK THRU TEC-EXIT.
MOVE ATWR-UNIT-RATE TO REQUIRED-RESERVES.
IF REQUIRED-RESERVES IS EQUAL TO ZEROS,
MOVE 5 TO REJECT-ERRORS (5),
PERFORM TRANSACTION-ERROR-CHECK THRU TEC-EXIT.
COMPUTE WORK-NUMBER = T-BILL-RATE * 100.
MOVE WORK-NUMBER TO T-BILL-PR.
COMPUTE WORK-NUMBER = REQUIRED-RESERVES * 100.
MOVE WORK-NUMBER TO RSV-PR.
MOVE ATWR-TRAN-DATE TO PROCESS-DATE-YMD.
MOVE ATWR-TRAN-DATE TO PACK-DATE.
MOVE ATWR-TRAN-DATE TO PACKED-DATE-YMD-CURR.
MOVE PD-YR TO CURR-YR.
MOVE PD-MO TO CURR-MO.
MOVE PD-DA TO CURR-DA.
* OVERRIDE CPU DATE AND USE TRANSACTION CONTROL FOR DATE
*
*
MOVE ATWR-TRAN-DATE TO R3-DATE-PR.
MOVE ATWR-HISTORY-PORTION TO AA-HISTORY-RECORD.
PERFORM WRITE-HISTORY-OUT THRU WHO-EXIT.
PERFORM READ-TRAN-IN THRU TRI-EXIT.
IF ATWR-TRAN-CODE IS NOT GREATER THAN 800,
MOVE AA-TRAN-WORK-REC TO WORK-REC-SAVE,
MOVE AAM-PARENT-ID TO ATWR-PARENT-ID.
PRINT-ALL-REPORT-HEADERS.
SET REPORT -SUB TO 1.
MOVE 1 TO PRINTING-CONTROL.
PRINT-ALL-HEADERS.
PERFORM COMMON-HEADING-ACTION THRU HEADINGS-EXIT.
IF PRINTING-CONTROL IS NOT LESS THAN 6,
GO TO PRINT-JOURNAL-BREAK.
ADD 1 TO PRINTING-CONTROL.
SET REPORT-SUB UP BY 1.
GO TO PRINT-ALL-HEADERS.
PRINT-JOURNAL-BREAK.
MOVE 3 TO PRINTING-CONTROL.
SET REPORT-SUB TO 3.
PERFORM ACCOUTING-JOURNAL-CHANGE THRU AJC-EXIT.
IF WORK-REC-SAVE IS NOT EQUAL TO SPACES,
MOVE WORK-REC-SAVE TO AA-TARN-WORK-REC.
MOVE ATWR-ACCOUNT-ID TO PREV-ACCOUNT-ID.
MOVE ATWR-CUSTOMER RO PREV-CUSTOMER,
GO TO MASTER-FILE-PROCESSING.
******************************************************************************
******************************************************************************
*********************** MAIN STREAM LOGIC FLOW OF CONTROL *******************
******************************************************************************
******************************************************************************
GET-NEXT-TRANSACTION.
PERFORM READ-TRAN-IN THRU TRI-EXIT.
MASTER-FILE-PROCESSING.
IF AAMI-EOF AND ATWR-EOF,
GO TO END-OF-POSTING.
MOVE ZERO TO SRT.
IF AAM-ACCT-NUMBER IS EQUAL TO AAM-PARENT-NUMBER,
AND AAM-ACCT-APPL-CODE IS EQUAL TO AAM-PARENT-APPL-CODE,
MOVE HIGH-VALUES TO AAM-PARENT-IDENTIFIER,
ELSE,
MOVE LOW-VALUES TO AAM-PARENT-IDENTIFIER.
IF ATWR-CUSTOMER IS GREATER THAN PREV-CUSTOMER,
GO TO END-ACCOUNT-ACITVITY.
IF ATWR-ACCOUNT-ID IS EQUAL TO AAM-ACCOUNT-ID,
PERFORM ACCOUNT-TRAN-UPDATE THRU ATU-EXIT,
GO TO GET-NEXT-TRANSACTION.
IF NEW-ACCOUNT-SETUP AND AAMI-EOF,
PERFORM ACCOUNT-TRAN-UPDATE THRU ATU-EXIT,
GO TO GET-NEXT-TRANSACTION.
IF ATWR-ACCOUNT-ID IS GREATER THAN AAM-ACCOUNT-ID,
GO TO END-ACCOUNT-ACTIVITY.
IF ATWR-ACCOUNT-ID IS LESS THAN AAM-ACCOUNT-ID,
AND ATWR-ACCOUNT-ID IS GREATER THAN PREV-ACCOUNT-ID,
AND NEW-ACCCOUNT-SETUP,
PERFORM ACCOUNT-TRAN-UPDATE THRU ATU-EXIT,
GO TO GET-NEXT-TRANSACTION,
ELSE,
MOVE 1 TO REJECT-ERRORS (1),
PERFORM TRANSACTION-ERROR-CHECK THRU TEC-EXIT,
GO TO GET-NEXT-TRANSACTION.
END-ACCCOUNT-ACTIVITY.
IF DDA-EXTRACT,
PERFORM DDA-INTERFACT THRU DDI-EXIT.
IF DDA-EXTRACT
AND DDA-HISTORY-MISSING,
MOVE HIGH-VALUE TO AAM-DORMANT-FLAG.
PERFORM HISTORY-FIELDS-UPDATING THRU HFU-EXIT.
IF AAM-MASTER-RECORD-PRINT IS EQUAL TO HIGH VALUE,
MOVE 3 TO PRINTING-CONTROL,
SET REPORT-SUB TO 3,
PERFORM TX-JOURNAL-RECAP THRU TJR-EXIT.
IF AAM-ACCT-NUMBER IS EQUAL TO AAM-PARENT-NUMBER,
AND AAM ACCT-APPL-CODE IS EQUAL TO AAM-PARENT-APPL-CODE,
MOVE HIGH-VALUES TO AAM-PARENT-IDENTIFIER,
ELSE,
MOVE LOW-VALUES TO AAM-PARENT-IDENTIFIER.
PERFORM MASTER-REPORTING THRU MR-EXIT.
PERFORM WRITE-MASTER-REC THRU WMR-EXIT.
MOVE AAM-ACCOUNT-ID TO PREV-ACCOUNT-ID.
MOVE AAM-CUSTOMER TO PREV-CUSTOMER.
MOVE ZEROS TO TOTAL-REQ-INV-BAL.
MOVE ZEROS TO SERVICE-CHARGE.
IF MASTER-SAVED,
MOVE AAM-SAVE TO AA-MASTER-RECORD,
MOVE ZERO TO MSTR-SV-FLAG,
GO TO MASTER-FILE-PROCESSING.
PERFORM READ-MASTER-IN THRU RMI-EXIT.
IF ATWR-USER-ID IS EQUAL TO 999,
AND AAMI-EOF,
GO TO END-OF-POSTING.
GO TO MASTER-FILE-PROCESSING.
ACCOUNT-TRAN-UPDATE.
IF AAM-DORMANT-FLAG IS EQUAL TO HIGH-VALUE,
AND NOT RE-ACTIVATE-ACCOUNT,
AND NOT NEW-ACCOUNT-SERUP,
MOVE 7 TO REJECT-ERRORS (7),
PERFORM TRANSACTION-ERROR-CHECK THRU TEC-EXIT,
GO TO ATU-EXIT.
PERFORM DIVISION-DEPT-XREF THRU DPX-EXIT.
MOVE PROCESS-DATE-YMD TO AAM-LAST-MAINT-DATE.
MOVE HIGH-VALUE TO AAM-MASTER-RECORD-PRINT.
IF ATWR-TRAN-CODE IS GREATER THAN 800,
NEXT SENTENCE,
ELSE,
GO TO PROCESS-ACCOUNT-FILE-MAINT.
MOVE AAM-PARENT-IDENTIFIER TO ATWR-PARENT-IDENTIFIER.
MOVE AAM-PARENT-ID TO ATWR-PARENT-ID.
MOVE AAM-S-I-C TO ATWR-S-I-C.
MOVE AAM-AREA-REFERENCE TO ATWR-AREA-REFERENCE.
MOVE AAM-OFFICER-NUMBER TO ATWR-OFFICER-NUMBER.
MOVE AAM-DEPARTMENT TO ATWR-DEPARTMENT.
MOVE AAM-N-A-FLAG TO ATWR-N-A-CODE.
MOVE AAM-STMT-FLAG TO ATWR-STMT-CODE.
MOVE AAM-ACCOUNT-TYPE TO ATWR-ACCOUNT-TYPE.
MOVE AAM-CB-REGION TO ATWR-CORR-BANK-REGION.
PERFORM PROCESS-SERVICE-TRANSACTION THRU PST-EXIT.
PERFORM TRANSACTION-ERROR-CHECK THRU TEC-EXIT.
IF GOOD-REC,
NEXT SENTENCE,
ELSE GO TO ATU-EXIT.
PERFORM SERVICE-TRANSACTION-REPORTING THRU STR-EXIT.
GO TO ATU-EXIT.
PROCESS-SERVICE-TRANSACTION.
MOVE ATWR-TRAN-CODE TO RF-TRAN-CODE.
MOVE ATWR-USER-ID TO RF-USER-ID.
PERFORM READ-RATE-FILE THRU RRF-EXIT.
IF NO-REC-FOUND,
MOVE 2 TO REJECT-ERRORS (2),
GO TO PST-EXIT.
IF ATWR-UNIT-RATE IS EQUAL TO ZEROS,
MOVE AASM-UNIT-RATE TO ATWR-UNIT-RATE.
CALCULATE-SERVICE-CHARGE.
COMPUTE SERVICE-CHARGE =
SERVICE-CHARGE + (ATWR-UNITS * ATWR-UNIT-RATE).
************************************************************************
************************************************************************
*********************** NOTE *****************************************
* TRANSACTION CODES BEGINNING WITH AN 8 WILL BE HANDLED IN A
* SPECIAL MANNER--------------------
* THE UNITS FIELD WILL REPROSENT A COLLECTED BALANCE
* AND AS SUCH WILL NOT BE USED IN THE EARNINGS BALANCE
* COMPUTATION. A VALUE OF +1 WILL BE USED FOR THE
* INVESTIBLE BALANCE PER UNIT FIGURE.
*
*
IF ATWR-TRAN-CODE IS GREATER THAN 79999 AND LESS THAN 98888,
MOVE 1 TO ATWR-INVST-BAL-UNIT,
GO TO COMPUTE-TOTAL-REQ-INV.
*
*
IF T-BILL-RATE IS EQUAL TO ZEROS,
MOVE ZEROS TO ATWR-INVST-BAL-UNIT,
GO TO COMPUTE-TOTAL-REQ-INV.
COMPUTE ATWR-INVST-BAL-UNIT,
= (ATWR-UNIT-RATE * 12) / T-BILL-RATE.
COMPUTE-TOTAL-REQ-INV.
COMPUTE TOTAL-REQ-INV-BAL =
TOTAL-REQ-INV-BAL + (ATWR-INVST-BAL-UNIT * ATWR-UNITS).
MOVE ATWR-HISTORY-PORTION TO AA-HISTORY-RECORD.
PERFORM WRITE-HISTORY-OUT THRU WHO-EXIT.
PST-EXIT.
EXIT.
PROCESS-ACCOUNT-FILE-MAINT.
IF DELET-ACCOUNT,
MOVE HIGH-VALUES TO AAM-DORMANT-FLAG.
IF NOW-ACCOUNT-SETUP,
PERFORM ADD-NEW-ACCOUNT THRU ANA-EXIT.
IF RE-ACTIVATE-ACCOUNT,
MOVE LOW-VALUES TO AAM-DORMANT-FLAG.
IF CHANGE-PARENT-ACCOUNT,
MOVE ATWR-PARENT-ID TO AAM-PARENT-ID,
IF AAM-ACCOUNT-ID IS EQUAL TO AAM-PARENT-ID,
MOVE HIGH-VALUES TO AAM-PARENT-IDENTIFIER,
ELSE,
MOVE LOW-VALUES TO AAM-PARENT-IDENTIFIER.
IF GOOD-REC,
NEXT SENTENCE,
ELSE,
GO TO ATU-EXIT.
PERFORM TRANSACTION-MAINT-REPORTING THRU TMR-EXIT,
GO TO ATU-EXIT.
ADD-NEW-ACCOUNT.
IF ATWR-ACCOUNT-ID IS EQUAL TO AAM-ACCOUNT-ID,
MOVE 6 TO REJECT-ERRORS (6),
PERFORM TRANSACTION-ERROR-CHECK THRU TEC-EXIT,
GO TO ANA-EXIT.
MOVE AA-MASTER-RECORD TO AAM-SAVE.
MOVE 1 TO MSTR-SV-FLAG.
MOVE ATWR-ACCOUNT-TYPE TO AAM-ACCOUNT-TYPE.
MOVE ATWR-CUSTOMER TO AAM-CUSTOMER.
MOVE ATWR-ACCOUNT-ID TO AAM-ACCOUNT-ID.
MOVE PROCESS-DATE-YMD TO AAM-LAST-MAINT-DATE.
MOVE PROCESS-DATE-YMD TO AAM-DATE-OPENED.
MOVE ATWR-PARENT-ID TO AAM-PARENT-ID.
MOVE ATWR-AREA-REFERENCE TO AAM-AREA-REFERENCE.
MOVE ATWR-N-A-CODE TO AAM-N-A-FLAG.
MOVE ATWR-STMT-CODE TO AAM-STMT-FLAG.
MOVE ATWR-CORR-BANK-REGION TO AAM-CB-REGION.
MOVE LOW-VALUE TO AAM-PARENT-IDENTIFIER.
MOVE LOW-VALUE TO AAM-DORMANT-FLAG.
IF AAM-ACCOUNT-ID IS EQUAL TO AAM-PARENT-ID,
MOVE HIGH-VALUES TO AAM-PARENT-IDENTIFIER.
INIT-MASTER-FM-FIELDS.
MOVE SPACES TO AAM-SHORT-TITLD,
MOVE SPACES TO AAM-DIVISION,
MOVE ZEROS TO AAM-S-I-C,
MOVE ZEROS TO AAM-OFFICER-NUMBER,
MOVE ZEROS TO AAM-DEPARTMENT,
MOVE ZEROS TO AAM-STATEMENT-CYCLE,
MOVE ZEROS TO AAM-O-D-LIMIT,
MOVE ZEROS TO AAM-STATEMENT-BALANCE,
MOVE ZEROS TO AAM-AVERAGE-LEDGER,
MOVE ZEROS TO INVESTIBLE,
MOVE ZEROS TO AAM-COLLECTED,
MOVE ZEROS TO AAM-INVESTIBLE-REQ,
MOVE ZEROS TO AAM-SERVICES.
ZERO-MASTER-BUCKETS.
SET INV-SUB, SERV-SUB REQ-SUB TO 1.
MOVE 1 TO MISC-COUNTER.
COUTINUE-TO-ZERO-BUCKETS.
MOVE ZEROS TO AAM-INVESTIBLE-HISTORY (INV-SUB).
MOVE ZEROS TO AAM-SERVCIE-HISTORY (SERV-SUB).
MOVE ZEROS TO AAM-INV-REQ-HISTORY (REQ-SUB).
IF MISC-COUNTER IS LESS THAN 12,
SET INV-SUB, SERV-SUB, REQ-SUB UP BY 1,
ADD 1 TO MISC-COUNTER,
GO TO CONTINUE-TO-ZERO-BUCKETS.
ANA-EXIT.
EXIT.
ATU-EXIT.
EXIT.
TRANSACTION-ERROR-CHECK.
CHECK-FOR-ERRORS.
MOVE ZTWR-TRAN-CODE TO R6-TRAN.
MOVE ATWR-SEQ-NUMBER TO R6-SERNUM.
MOVE ATWR-ACCT-APPL-CODE TO R6-APPL.
MOVE ATWR-ACCT-NUMBER TO R6-ACCOUNT.
SET RMT-SUB TO 1.
MOVE 6 TO PRINTING-CONTROL.
SET REJ-SUB TO 1.
SET REPORT-SUB TO 6.
CONTINUE-SEARCH.
SEARCH REJECT-ERRORS VARYING RMT-SUB,
AT END TO TO END-DFE,
WHEN REJECT-ERRORS (REJ-SUB) IS NOT EQUAL TO ZEROS,
MOVE ZEROS TO REJECT-ERRORS (REJ-SUB),
MOVE 1 TO SRT,
MOVE REJECT-REASONE (RMT-SUB) TO R6-MSG,
MOVE AAM020-R6-DTL TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB),
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT,
MOVE SPACES TO AAM020-R6-DTL,
GO TO CONTINUE-SEARCH.
END-CFE.
GO TO TEC-EXIT.
TEC-EXIT.
EXIT.
DIVISION-DEPT-XREF.
SET DIVTAB TO 1.
SEARCH-FOR-DEPT.
SEARCH DIVISION-DEPT-TABLE,
AT END TO TO DPX-EXIT,
WHEN DIV OF DIVISION-DEPT-TABLE (DIVTAB-SUB)
IS EQUAL TO AAM-DIVISION,
MOVE DEPT OF DIVISION-DEPT-TABLE (DIVTAB-SUB)
TO AAM-DEPARTMENT.
DPX-EXIT.
EXIT.
DDA-INTERFACE.
SEARCH-DDA-HISTORY.
IF DDHST-EOF,
MOVE NO-HISTORY TO DDA-HISTORY-FLAG,
GO TO SEARCH-DDA-TRANS.
MOVE ACCTO TO BINARY-DDA-ACCOUNT.
IF CHAR-7F IS EQUAL TO FIRST-POSITION,
PERFORM READ-DDA-HISTORY THRU RDH-EXIT,
GO TO SEARCH-DDA-HISTORY.
IF AAM-ACCT-NUMBER IS EQUAL TO DDA-ACCOUT,
PEROFRM DDA-HISTORY-ROUTINES THRU DHR-EXIT,
GO TO SEARCH-DDA-TRANS.
IF AAM-ACCT-NUMBER IS GREATER THAN DDA-ACCOUNT,
PERFORM READ-DDA-HISTORY THRU RDH-EXIT,
GO TO SEARCH-DDA-HISTORY.
IF AAM-ACCT-NUMBER IS LESS THAN DDA-ACCOUNT,
MOVE NO-HISTORY TO DDA-HISTORY-FLAG.
GO TO SEARCH-DDA-TRANS.
DDA-HISTORY-ROUTINES.
MOVE ZEROS TO DDA-HISTORY-FLAG.
IF AAM-DORMANT-FLAG IS EQUAL TO HIGH-VALUE,
GO TO DHR-EXIT.
FILE-MAINT-PASS.
MOVE ZEROS TO BINARY-UMBER-1.
MOVE ZEROS TO BINARY-NUMBER-2.
MOVE DIVO TO AAM-DIVISION.
PERFORM DIVISION-DEPT-XREF THRU DPX-EXIT.
MOVE OFF10 TO BINARY-BYTE.
MOVE BINARY-NUMBER-1 TO AAM-OFFICER-NUMBER.
MOVE SICO TO TWO-BINARY-BYTES.
MOVE BINARY-NUMBER-2 TO AAM-S-I-C.
MOVE SHTNMDO TO AAM-SHORT-TITLE.
MOVE ZEROS TO BINARY-NUMBER-2.
MOVE DATOPNO TO TWO-BINARY-BYTES.
MOVE BINARY-NUMBER-2 TO AAM-DATE-OPENED.
MOVE STMTCYO TO AAM-STATMENET-CYCLE.
MOVE SCACTO TO R2D1-WAVE-CODE.
IF ODPOINTO IS EQUAL TO 'N',
MOVE ZEROS TO AAM-O-D-LIMIT,
GO TO AFTER-LIMIT.
IF ODPOINTO IS EQUAL TO 'A',
MOVE 9999999 TO AAM-O-D-LIMIT,
GO TO AFTER-LIMIT.
MOVE ZEROS TO BINARY-NUMBER-1.
MOVE ODPOINTO TO BINARY-BYTE.
MOVE BINARY-NUMBER-1 TO AAM-O-D-LIMIT.
AFTER-LIMIT.
COMPUTE WORK-NUMBER = AVGLGRO (1) * 10.
MOVE WORK-NUMBER TO AAM-AVERAGE-LEDGER.
COMPUTE WORK-NUMBER = AVGCOLO (1) * 10.
MOVE WORK-NUMBER TO AAM-COLLECTED.
DHR-EXIT.
EXIT.
SEARCH-DDA-TRANS.
IF DDTR-EOF,
MOVE NO-TRANS TO DDA-TRAN-FLAG,
GO TO DDI-EXIT.
MOVE ACCTT TO BINARY-DDA-ACCOUNT.
IF CHAR-7F IS EQUAL TO FIRST-POSITION,
PERFORM READ-DDA-TRANS THRU RDT-EXIT,
GO TO SEARCH-DDA-TRANS.
IF AAM-ACCT-NUMBER IS EQUAL TO DDA-ACCOUNT,
PERFORM DDA-TRANS-ROUTINES THRU DTR-EXIT,
PERFORM DDA-EXTRACT-MAINTENANCE THRU DEM-EXIT,
MOVE WORK-REC-SAVE TO AA-TRAN-WORK REC,
GO TO DDI-EXIT.
*******************************************************************
*******************************************************************
**************** RETURN SAVED TRANSACTION ***********************
**************** AFTER GENERATING DDA TRANASACTIONS ***************
*******************************************************************
*
IF AAM-ACCT-NUMBER IS GREATER THAN DDA-ACCOUNT,
PERFORM READ-DDA-TRANS THRU RDT-EXIT,
GO TO SEARCH-DDA-TRANS.
IF AAM-ACCT-NUMBER IS LESS THAN DDA-ACCOUNT,
MOVE NO-TRANS TO DDA-TRAN-FLAG.
GO TO DDI-EXIT.
DDA-TRANS-ROUTINES.
MOVE ZEROS TO DDA-TRAN-FLAG.
IF AAM-DORMANT-FLAG IS EQUAL TO HIGH-VALUE
GO TO DTR-EXIT.
DDA-TRAN-FILL-IN.
MOVE AA-TRAN-WORK-REC TO WORK-REC-SAVE.
MOVE AAM-CUSTOMER TO ATWR-CUSTOMER.
MOVE AAM-ACCOUNT-ID TO ATWR-ACCOUNT-ID.
ADD 1 TO GEN-SEQ-NUM.
MOVE GEN-DWQ-NUM TO ATWR-SEQ-NUMBER.
MOVE PROCESS-DATE-YMD TO ATWR-TRAN-DATE.
MOVE ZERO TO ATWR-DESCRIPTION-COUNT.
GENERATE-CREDIT-TRAN.
IF AAM-ACCT-NUMBER IS LESS THAN 8000000
OR
GREATER THAN 8999999,
NEXT SENTENCE,
ELSE,
GO TO GENERATE-DEBIT-TRAN.
IF NOCRT IS NOT GREATER THAN ZERO,
GO TO GENERATE-DEBIT-TRAN.
MOVE DDA-CREDIT-TRAN TO ATWR-TRAN-CODE.
MOVE ZEROS TO ATWR-UNIT-RATE.
MOVE NOCRT TO ATWR-UNITS.
PERFORM ACCOUNT-TRAN-UPDATE THRU ATU-EXIT.
GENERATE-DEBIT-TRAN.
IF NODBT IS NOT GREATER TAHN ZERO,
GO TO GENERATE-ITEM-TRAN.
ADD 1 TO GEN-SEQ-NUM.
MOVE GEN-DWQ-NUM TO ATWR-SEQ-NUMBER.
MOVE DDA-DEBIT-TRAN TO ATWR-TRAN-CODE.
MOVE ZEROS TO ATWR-UNIT-REATE.
MOVE NODBT TO ATWR-UNITS.
PERFORM ACCOUNT-TRAN-UPDATE THRU ATU-EXIT.
GENERATE-ITEM-TRAN.
ADD 1 TO GEN-SEQ-NUM.
MOVE LOCDEPT TO ATWR-UNITS.
ADD OTHDEPT TO ATWR-UNITS.
IF ATWR-UNITS IS NOT GREATER THAN ZERO,
MOVE ZEROS TO ATWR-UNIT-RATE,
GO TO GENERATE-MAINT-CHARGE.
MOVE GEN-SEQ-NUM TO ATWR-SEQ-NUMBER.
MOVE ZEROS TO ATWR-UNIT-RATE.
IF (AAM-ACCT-NUMBER IS GREATER THAN 8000000 AND LESS THAN 8999999),
AND,
SCFACO IS EQUAL TO '1',
MOVE REDUCED-ITEM-TRAN TO ATWR-TRAN-CODE,
ELSE,
MOVE ITEM-TRAN-CODE TO ATWR-TRAN-CODE.
PERFORM ACCOUNT-TRAN-UPDATE THRU ATU-EXIT.
GENERATE-MAINT-CHARGE.
IF (AAM-ACCT-NUMBER IS GREATER THAN 8000000 AND LESS THAN 8999999,
NEXT SENTENCE,
ELSE,
ADD 1 TO GEN-DEQ-NUM,
MOVE 1 TO ATWR-UNITS,
MOVE ZEROS TO ATWR-UNIT-RATE,
MOVE MAINT-TRAN-CODE TO ATWR-TRAN-CODE,
PERFORM ACCOUNT-TRAN-UPDATE THRU ATU-EXIT.
GENERATE-AD-VALOREM-CREDIT.
**************************************************************************
****************** MODIFIED TO NO-OP CREDIT TO PARENT ACCOUNTS **********
**************************************************************************
IF AAM-PARENT-IDENTIFIER IS EQUAL TO HIGH-VALUE,
AND AAM-COLLECTED IS NEGATIVE,
GO TO DTR-EXIT.
**************************************************************************
MOVE ZEROS TO ATWR-UNIT-RATE.
IF AAM-ACCT-NUMBER IS LESS THAN 8000000
OR GREATER THAN 8999999,
NEXT SENTENCE,
ELSE,
GO TO DTR-EXIT.
IF AAM-COLLECTED IS NOT EQUAL TO ZERO,
NEXT SENTNECE,
ELSE,
GO TO DTR-EXIT.
ADD 1 TO GEN-SEQ-NUM.
MOVE GEN-SEQ-NUM TO ATWR-SEQ-NUMBER.
MOVE DDA-AD-VOLOREM TO ATWR-TRAN-CODE.
COMPUTE ATWR-UNITS ROUNDED = AD-VOLOREM-RATE * AAM-COLLECTED.
PERFORM ACCOUNT-TRAN-UPDATE THRU ATU-EXIT.
DTR-EXIT.
EXIT.
DDI-EXIT.
EXIT.
ALL-FILE-WIRTES SECTION 10.
WRITE-HISTORY-OUT.
CALL 'AAHISTO' USING IO-RETURN, WRITE-DEQ, AA-HISTORY-RECORD.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
WHO-EXIT.
EXIT.
WRITE-REPORT-RECORD.
CALL 'RPTWTR' USINT IO-RETURN, WIRTE-SEQ, SPOOL-REPORT-RECORD.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
WRR-EXIT.
EXIT.
WRITE-MASTER-REC.
CALL 'AAMRECO' USING IO-RETURE, WRITE-SEQ, AA-MASTER-RECORD.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
WMR-EXIT.
EXIT.
WRITE-FILES-EXIT.
EXIT.
ALL-FILE-READS SECTION 10.
READ-MASTER-IN.
IF AAMI-EOF,
MOVE HIGH-VALUES TO AAM-CUSTOMER,
MOVE HIGH-VALUES TO AAM-ACCT-APPL-CODE,
MOVE ALL '9' TO AAM-ACCT-NUMBER,
MOVE 9 TO AAM-CHK-DIGIT,
GO TO RMI-EXIT.
CALL 'AAMRECI' USING IO-RETURN, READ-SEQ, AA-MASTER-RECORD.
IF GOOD-RETURN OR END-OF-FILE,
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
IF END-OF-FILE,
MOVE IO-RETURN TO AAMI-STATUS,
MOVE HIGH-VALUES TO AAM-CUSTOMER,
MOVE HIGH-VALUES TO AAM-ACCT-APPL-CODE,
MOVE 9 TO AAM-CHK-DIGIT,
MOVE ALL '9' TO AAM-ACCT-NUMBER.
RMI-EXIT.
EXIT.
READ-DDA-TRANS.
IF DDTR-EOF,
GO TO RDT-EXIT.
CALL 'DDTRAN' USING IO-RETURN, READ-SEQ, DDA-HISTORY-TRANS.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
IF END-OF-FILE,
MOVE IO-RETURN TO DD-TRANS-STATUS,
MOVE ALL '9' TO ACCTT.
RDT-EXIT.
EXIT.
READ-DDA-HISTORY.
IF DDHST-EOF,
GO TO RDH-EXIT.
CALL 'DDHIST' USING IO-RETURN, READ-SEQ, DDA-HISTORY-MASTER.
IF GOOD-RETURN OR END-OF-FILE,
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
IF END-OF-FILE,
MOVE IO-RETURN TO DD-HIST-STATUS,
MOVE ALL '9' TO ACCTO.
RDH-EXIT.
EXIT.
READ-TRAN-IN.
IF ATWR-EOF,
GO TO RTI-EXIT.
CALL 'TRANWRK' USING IO-RETURN, READ-SEQ, AA-TRAN-WORK-REC.
IF GOOD-RETURN OR END-OF-FILE,
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
IF END-OF-FILE,
MOVE ALL '9' TO ATWR-TRAM-CODE,
MOVE IO-RETURN TO ATWR-STATUS,
MOVE ALL '9' TO ATWR-ACCT-NUMBER,
MOVE HIGH-VALUES TO ATWR-CUSTOMER,
GO TO TRI-EXIT.
MOVE ATWR-TRAN-CODE TO TRAN-CODE-BREAK.
RTI-EXIT.
EXIT.
READ-RATE-FILE.
CALL 'RANDRATE' USING IO-RETURN, READ-RANDOM, AA-SERVICE-MASTER, RF-KEY.
RRF-EXIT.
EXIT
ALL-FILE-READ-EXIT.
EXIT.
DETERMINE-ERROR.
MOVE IO-RETURN TO RETURN-CODE.
DISPLAY 'AAM020I ERROR IN IO DRIVER - ABEND'.
MOVE SPACES TO AA-CUSTOMER.
ADD 1 TO AAM-USER-ID.
DET-ER-EXIT.
EXIT.
CHECK-FOR-NEW-PAGE.
CHECK-LINE-COUNT.
IF LINE-COUNT OF REPORT-TABLE (REPORT-SUB)
IS GREATER THAN MAX-LINES,
PERFORM VARIOUS-HEADING-ROUTINES THRU HEADINGS-EXIT.
NEW-PAGE-EXIT.
EXIT.
OUTPUT-REPORT-RECORD.
MOVE REPORT-TABLE (REPORT-SUB) TO SPOOL-REPORT-RECORD.
PERFORM WRITE-REPORT-RECORD THRU WRR-EXIT.
PERFORM CHECK-FOR-NEW-PAGE THRU NEW-PAGE-EXIT.
ADD 1 TO LINE-COUNT OF REPORT-TABLE (REPORT-SUB).
MOVE SPACE-ONE TO SPACING OF REPORT-TABLE (REPORT-SUB).
ORR-EXIT.
EXIT.
MASTER-REPORTING SECTION.
IF AAM-MSTER-RECORD-PRINT IS EQUAL TO HIGH-VALUE,
NEXT SENTENCE,
ELSE,
GO TO GMRP-EXIT.
MOVE LOW-VALUES TO AAM-MASTER-RECORD-PRINT.
GENERATE-MASTER-RECORD-PRINT.
MOVE AAM-USER-ID TO R4-USER-ID.
MOVE AAM-BRANCH TO R4-BRANCH.
MOVE AAM-ACCT-APPL-CODE TO R4-ACCT-APPL.
MOVE AAM-PARENT-APPL-CODE TO R4-PAR-APPL.
MOVE AAM-ACCT-NUMBER TO R4-ACCT-NUMBER.
MOVE AAM-PARENT-NUMBER TO R4-PARENT-NUMBER.
MOVE AAM-SHORT-TITLE TO R4-SHORT-TITLE.
MOVE AAM-AREA-REFERENCE TO R4-AREA-REFERENCE.
MOVE AAM-S-I-C TO R4-S-I-C.
MOVE AAM-OFFICER-NUMBER TO R4-OFFICER-NUMBER.
MOVE AAM-DEPARTMENT TO R4-DEPARTMENT.
MOVE AAM-LAST-MAINT-DATE TO R4-LAST-ACTIVE.
MOVE ZEROS TO R4-DTE-OPENED.
MOVE AAM-STATEMENT-CYCLE TO R4-STMT-CYCLE.
MOVE AAM-CB-REGION TO R4-CORR.
MOVE AAM-INVESTIBLE TO R4-INVESTIBLE.
MOVE AAM-ERVICES TO R4-SERVICES.
MOVE AAM-COLLECTED TO R4-COLLECTED.
MOVE AAM-AVERAGE-LEDGER TO R4-AVG-LEDGER.
MOVE AAM-DIVISION TO R4-DIVISION.
MOVE AAM-O-D-LIMIT TO R4-OD-FLAG.
MOVE AAM-ACCOUNT-TYPE TO R4-ACCOUNT-TYPE.
MOVE AAM-N-A-FLAG TO R4-N-A-CODE.
MOVE AAM-STMT-FLAG TO R4-STMT-CD.
SUBTRACT TOTAL-REQ-INV-BAL FROM AAM-INVESTIBLE,
GIVING WORK-NUMBER.
MOVE WORK-NUBMER TO R4-NEW-INVESTIBLE.
MOVE 4 TO PRINTING-CONTROL.
SET REPORT-SUB TO 4.
MOVE AAM020-R4-DTL1 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB).
MOVE AAM020-R4-HD3 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE AAM020-R4-HD4 TO REPORT LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB).
MOVE AAM020-R4-DTL2 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB).
PRINT-BODY-OF-R4.
SET PATTRN-SUB TO 1.
MOVE 1 TO DDA-SUB.
MOVE 1 TO DDA-TOTAL-SUB.
PRINT-R4-DETAIL.
MOVE AVL TO R4-CMMT-LINE.
MOVE AAM020-R4-HD5 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB).
PERFORM MOVE-AND-PRINT-AVLB THRU PRAVLB-EXIT.
MOVE ACB TO R4-CMMT-LINE.
MOVE AAM020-R4-HD5 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB).
PERFORM MOVE-AND-PRINT-ACLB THRU PRACLB-EXIT.
GO TO MOVE-AND-PRINT-AAM-INVST-HST.
MOVE-AND-PRINT-AVLB.
MOVE AAM020-R4-HD6-TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
IF DDA-HISTORY-MISSING,
MOVE SPACES TO REPORT-LINE OF REPORT-TABLE (REPORT-SUB),
MOVE 'MISSING DDA INFORMATION ' TO
REPORT-LINE OF REPORT-TABLE (REPORT-SUB),
PERFORM OUTPUT-REOPRT-RECORD THRU ORR-EXIT,
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB),
GO TO PRAVLB-EXIT.
MOVE 2 TO DDA-SUB.
SET PATTERN-SUB TO 1.
MOVE 7 TO LOOP-LIMIT.
AVLB-PR-LOOP.
COMPUTE WORK-NUMBER = AVGLGRO (DDA-SUB) * 10.
MOVE WORK-NUMBER TO EDIT-PATRN (PATTRN-SUB).
ADD 1 TO DDA-SUB.
IF DDA-SUB IS NOT GREATER THAN LOOP-LIMIT,
SET PATTRN-SUB UP BY 1,
GO TO AVLB-PR-LOOP.
AVLB-LP-EXIT.
EXIT.
PRINT-AVLB-LINE1.
MOVE PATTERN-TABLE TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB).
MOVE AAM020-R4-HD7 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE 13 TO LOOP-LIMIT.
SET PATTRN-CUB TO 1.
PERFORM AVLB-PR-LOOP THRU AVLB-LP-EXIT.
MOVE PATTERN-TABLE TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB).
PRAVLB-EXIT.
EXIT.
MOVE-AND-PRINT-ACLB.
MOVE AAM020-R4-HD6 TO REOPRT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
IF DDA-HSOTRY-MISSING,
MOVE SPACES TO REPORT-LINE
OF REOPRT-TABLE (REPORT-SUB),
MOVE 'MISSING DDA INFORMATION' TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB),
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT,
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB),
GO TO PRACLB-EXIT.
MOVE 2 TO DDA-SUB.
SET PATTRN-SUB TO 1.
MOVE 7 TO LOOP-LIMIT.
ACLB-PR-LOOP.
COMPUTE WORK-NUMBER = AVGCOLO (DDA-SUB) * 10.
MOVE WORK-UMBER OT EDIT-PATRN (PATTRN-SUB).
ADD 1 TO DDA-SUB.
IF DDA-SUB IS NOT GREATER THAN LOOP-LIMIT,
SET PATTRN-SUB UP BY 1,
GO TO ACLB-PR-LOOP.
ACLB-LP-EXIT.
EXIT.
PRINT-ACLB-LINE1.
MOVE PATTERN-TABLE TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE 13 TO LOOP-LIMIT.
SET PATTRN-SUB TO 1.
PERFORM ACLB-PR-LOOP THRU ACLB-LP-EXIT.
MOVE PATTERN-TABLE TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB).
PRACLB-EXIT.
EXIT.
MOVE-AND-PRINT-AAM-INVST-HST.
MOVE AIB TO R4-CMMT-LINE.
MOVE AAM020-R4-HD5 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE AAM020R4-HD6 TO REPORT-LINE OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE 1 TO LOOP-CONTROL.
SET PATTRN-SUB TO 1.
SET INV-SUB TO 1.
MOVE 6 TO LOOP-LIMIT.
AAM-HSTY-LOOP-INV.
MOVE AAM-INVESTIBLE-HISTORY (INV-SUB)
TO EDIT PATRN (PATTRN-SUB.
SET INV-SUB UP BY 1.
ADD 1 TO LOOP-CONTROL.
IF LOOP-CONTROL IN NOT GREATER THAN LOOP-LIMIT,
SET PATTRN-SUB UP BY 1,
GO TO AAM-HSTY-LOOP-INV.
AAM-LOOP-INV.
EXIT.
PRINT-INV-LINE1.
MOVE PATTERN-TABLE TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING OF REPORT-TABLE (REPORT-SUB).
MOVE AAM020-R4-HD7 TO REPORT-LINE OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE 12 TO LOOP-LIMIT.
SET PATTRN-SUB TO 1.
PERFORM AAM-HSTY-LOOP-INV THRU AAM-LOOP-INV.
MOVE PATTERN-TABLE TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TALBE (REPORT-SUB).
MVE-PRT-INV.
EXIT.
MOVE-ANT-PRINT-AAM-SERVICE.
MOVE SRV TO R4-CMMT-LINE.
MOVE AAM020-R4-HD5 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE AAM020-R4-HD6 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE 1 TO LOOP-CONTROL.
SET PATTRN-SUB TO 1.
SET SERV-SUB TO 1.
MOVE 6 TO LOOP-LIMIT.
AAM-HSTY-LOOP-SERV.
MOVE AAM-SERVICE-HISTORY (SERV-SUB)
TO EDIT-PATTRN OF EDIT-ENTRY (PATTRN-SUB).
SET SERV-SUB UP BY 1.
ADD 1 TO LOOP-CONTROL.
IF LOOP-CONTROL IS NOT GREATER THAN LOOP-LIMIT,
STE PATTRN-SUB UP BY 1,
GO TO AAM-HSTY-LOOP-SERV.
AAM-LOOP-SERV.
EXIT.
PRINT-SERV-LINE1.
MOVE PATTERN-TABLE TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
MOVE AAM020-R4-HD7 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE 12 TO LOOP-LIMIT.
SET PATTRN-SUB TO 1.
PERFORM AAM-HSTY-LOOP THRU AAM-LOOP-SERV.
MOVE PATTERN-TABLE TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
MVE-PRT-SRV.
EXIT.
MOVE-AND-PRINT-AAM-REQUIRED.
MOVE IBR TO R4-CMMT-LINE.
MOVE AAM020-R4-HD5 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE AAM020-R4-HD6 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE 1 TO LOOP-CONTROL.
SET PATTRN-SUB TO 1.
SET REQ-SUB TO 1.
MOVE 6 TO LOOP-LIMIT.
AAM-HSTY-LOOP-REQ.
MOVE AAM-INV-REQ-HISTORY (REQ-SUB)
TO EDIT-PATTRN OF EDIT-ENTRY (PATTRN-SUB).
IF LOOP-CONTROL IS NOT GREATER TAHN LOOP-LIMIT,
SET PATTRN-SUB UP BY 1,
GO TO AAM-HSTY-LOOP-REQ.
AAM-LOOP-REQ.
EXIT.
PRINT-REQ-LINE1.
MOVE PATTERN-TABLE TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REOPRT-TABLE (REPORT-SUB).
MOVE AAM020-R4-HD7 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE 12 TO LOOP-LIMIT.
SET PATTRN-SUB TO 1.
PERFORM AAM-HSTY-LOOP-REQ THRU AAM-LOOP-REQ.
MOVE PATTERN-TABLE TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
SET-UP-NEXT-PAGE.
PERFORM COMMON-HEADING-ACTION THRU HEADINGS-EXIT.
MVE-PRT-REQ.
EXIT.
GMRP-EXIT.
EXIT.
CHECK-DORMANT-ACCOUNT.
IF AAM-DORMANT-FLAG IS NOT EQUAL TO LOW-VALUE,
NEXT SENTENCE,
ELSE,
GO TO MR-EXIT.
PRINT-DORMANT-REPORT.
MOVE 5 TO PRINTING-CONTROL.
SET EPORT-SUB TO 5.
IF AAM-CUSTOMER IS NOT EQUAL TO PREV-CUSTOMER,
MOVE AAM-USER-ID TO SEARCH-USER-ID,
MOVE AAM-BRANCH TO SEARCH-BRANCH,
PERFORM CUSTOMER-SEARCH THRU CUSTOMER-SRC-EXIT,
PERFORM VARIOUS-HEADING-ROUTINES THRU HEADINGS-EXIT.
MOVE AAM-ACCT-NUMBER TO R5-ACCT-NUMBER.
MOVE AAM-SHORT-TITLE TO R5-SHORT-TITLE.
MOVE AAM-LAST-MAINT-DATE TO R5-LAST-ACTIVE.
MOVE AAM-PARENT-NUMBER TO R5-PARENT-NUMB.
MOVE AAM-ACCT-APPL-CODE TO R5-APPL-CODE.
MOVE AAM020-R5-DTL TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MR-EXIT.
EXIT.
VARIOUS-HEADING-ROUTINES SECTION.
COMMON-HEADING-ACTION.
MOVE SPACE-TOP TO SPACING
OF REPORT-TABLE (REPORT-SUB).
MOVE ZEROS TO LINE-COUNT
OF REPORT-TABLE (REPORT-SUB).
ADD 1 TO PAGE-COUNT OF REPORT-TABLE (REPORT-SUB).
MOVE SPACES TO REPORT-LINE
OF REPROT-TABLE (REPORT-SUB).
MOVE PAGE-COUNT OF REPORT-TABLE (REPORT-SUB) TO R0-PAGE-NUMBER.
MOVE REPORT-TITLE (PRINTING-CONTROL) TO R0-REPORT-TITLE.
MOVE REPORT-NUMBER (PRINTING-CONTROL) TO R0-REPORT-NUMBER.
MOVE PR-CUSTOMER TO R0-CUSTOMER.
MOVE R0-HD1-LINE TO REPROT-LINE
OF REPORT-TABLE (REPORT-SUB).
MOVE REPORT-TABLE (REPORT-SUB) TO SPOOL-REPORT-RECORD.
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
IF PR-BRANCH IS NOT EQUAL TO SPACES,
NEXT SENTENCE,
ELSE GO TO BYPASS-BRANCH-HEADING.
MOVE PR-BRANCH TO R0-CUSTOMER.
MOVE SPACE-TWO TO SPACING OF
REPORT-TABLE (REPORT-SUB).
ADD 2 TO LINE-COUNT OF
REPORT-TABLE (REPORT-SUB).
MOVE R0-HD1-LINE TO REPORT-LINE (REPORT-SUB).
MOVE REPORT-TABLE (REPORT-SUB TO SPOOL-REPORT-RECORD.
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
BYPASS-BRANCH-HEADING.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
ADD 2 TO LINE-COUNT
OF REPORT-TABLE (REPORT-SUB).
MOVE R0-HD2-LINE TO REPORT-LINE (REPORT-SUB).
MOVE REPORT-TABLE (REPORT-SUB) TO SPOOL-REPORT-RECORD.
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-THREE TO SPACING
OF REPORT-TABLE (REPORT-SUB).
PRINT-HEADING-ROUTER.
GO TO
HEADING-R1,
HEADING-R2,
HEADING-R3,
HEADING-R4,
HEADING-R5,
HEADING-R6
DEPENDING ON PRINTING-CONTROL.
GO TO NEW-PAGE-EXIT.
PR-HD-EXIT.
EXIT.
HEADING-R1.
MOVE AAM020-R1-DTL-HEAD TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
GO TO HEADINGS-EXIT.
HEADING-R2.
MOVE AAM020-R2-DTL-HD1 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-ONE TO SPACING
OF REPORT-TABLE (REPORT-SUB).
MOVE AAM020-R2-DTL-HD2 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
ADD 3 TO LINE-COUNT
OF REPORT-TABLE (REPORT-SUB).
GO TO HEADINGS-EXIT.
HEADING-R3.
MOVE AAM020-R3-DTL-HD0 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
MOVE AAM020-R3-DTL-HD1 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-ONE TO SPACING
OF REPORT-TABLE (REPORT-SUB).
MOVE AAM020-R3-DTL-HD2 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
ADD 3 TO LINE-COUNT
OF REPORT-TABLE (REPORT-SUB).
GO TO HEADINGS-EXIT.
HEADING-R4.
MOVE AAM020-R4-DTL-HD1 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-ONE TO SPACING
OF REPORT-TABLE (REPORT-SUB).
MOVE AAM020-R4-DTL-HD2 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
ADD 3 TO LINE-COUNT
OF REPORT-TABLE (REPORT-SUB).
GO TO HEADINGS-EXIT.
HEADING-R5.
MOVE AAM020-R5-HD1 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
ADD 2 TO LINE-COUNT
OF REPORT-TABLE (REPORT-SUB).
GO TO HEADINGS-EXIT.
HEADING-R6.
MOVE AAM020-R6-HD TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
ADD 2 TO LINE-COUNT
OF REPORT-TABLE (REPORT-SUB).
GO TO HEADINGS-EXIT.
HEADINGS-EXIT.
EXIT.
HISTORY-FIELDS-UPDATING.
BUMP-HISTORY-TOTALS.
SET INV-SUB TO 12.
SET SERV-SUB TO 12.
SET REQ-SUB TO 12.
PERFORM HISTORY-BUMP THRU HISTORY-BUMP-EXIT,
VARYING MISC-COUNTER FROM 1 BY 1
UNTIL MISC-COUNTER IS GREATER THAN 11.
GO TO SET-CURRENT-TOTALS.
HISTORY-BUMP.
MOVE AAM-INVESTIBLE-HISTORY (INV-SUB -1)
TO AAM-INVESTIBLE-HISTORY (INV-SUB).
MOVE AAM-SERVICE-HISTORY (SERV-SUB -1)
TO AAM-SERVICE-HISTORY (SERV-SUB).
SET INV-SUB DOWN BY 1.
SET SERV-SUB DOWN BY 1.
SET REQ-SUB DOWN BY 1.
HISTORY-BUMP-EXIT.
EXIT.
SET-CURRENT-TOTALS.
SET SERV-SUB TO 1.
SET INV-SUB TO 1.
SET REQ-SUB TO 1.
ROUND-ALL-FIELDS.
COMPUTE AAM-SERVICE-HISTORY (SERV-SUB)
ROUNDED = ZERO + AAM-SERVICES.
COMPUTE AAM-SERVICE
ROUNDED = ZERO + SERVICE-CHARGE.
MOVE SERVICE-CHARGE TO SCHG-HOLD.
COMPUTE AAM-INVESTIBLE-HISTORY (INV-SUB)
ROUNDED = ZERO + AAM-INVESTIBLE.
COMPUTE AAM-INV-REQ-HISTORY (REP-SUB
ROUNDED = ZERO + AAM-INVESTIBLE-REQ.
COMPUTE AAM-INVESTIBLE-REQ
ROUNDED = ZERO + TOTAL-REQ-INV-BAL.
*******************************************************************
*******************************************************************
**************** MODIFICATION TO NO-OP CREDIT TO PARENT ACCOUNTS *
*******************************************************************
*
IF AAM-PARENT-IDENTIFIER IS EQUAL TO HIGH-VALUE,
AND AAM-COLLECTIED IS NEGATIVE,
MOVE AAM-COLLECTED TO AAM-INVESTIBLE,
TO TO HFU-EXIT.
*******************************************************************
*
COMPUTE AAM-INVESTIBLE
ROUNDED = AAM-COLLECTED -
(AAM-COLLECTED * REQUIRED-RESERVES).
*******************************************************************
HFU-EXIT.
EXIT.
SERVICE-TRANSACITON-REPORTING.
TRANSACTION-JOURNAL.
MOVE 3 TO PRINTING-CONTROL.
SET REPORT-SUB TO 3.
IF ATWR-CUSTOMER IS NOT EQUAL TO PREV-CUSTOMER,
MOVE ATWR-USER-ID TO SEARCH-USER-ID,
MOVE ATWR-BRANCH TO SEARCH-BRANCH,
PERFORM CUSTOMER-SEARCH THRU CUSTOMER-SRC-EXIT,
PERFORM VARIOUS-HEADING-ROUTINES THRU HEADINGS-EXIT.
IF ATWR-ACCOUNT-ID IS NOT EQUAL TO PREV-ACCOUNT-ID,
NEXT SENTENCE,
ELSE,
GO TO PRINT-DETAIL-TX-LINE.
ACCOUNT-JOURNAL-CHANGE.
MOVE ATWR-ACCOUTN-ID TO PREV-ACCOUNT-ID.
MOVE ATWR-USER-ID TO R3-USER-ID.
MOVE ATWR-BRANCH TO R3-BRANCH.
MOVE ATWR-ACCT-NUMBER TO R3-ACCT-NUMBER.
MOVE ATWR-PARENT-NUMBER TO R3-RLTD-NUMBER.
MOVE AAM-SHORT-TITLE TO R3-SHORT.
MOVE AAM020-R3-DTL1 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
ADD 2 TO LINE COUNT
OF REPORT-TABLE (REPORT-SUB).
MOVE AAM020-R3-DTL-HD3 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
ADD 2 TO LINE-COUNT
OF REPORT-TABLE (REPORT-SUB).
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
AJC-EXIT.
EXIT.
PRINT-DETAIL-TX-LINE.
MOVE ATWR-TRAN-CODE TO R3-TRAN-CODE.
MOVE ATWR-SEQ-NUMBER TO R3-SEQ.
MOVE ATWR-UNITS TO R3-UNITS.
COMPUTE WORK-NUMBER = ATWR-UNITS * ATWR-UNIT-RATE.
MOVE WORK-NUMBER TO R3-NET-CHARGE.
ADD 1 TO TRANSACTION-COUNT.
ADD ATWR-UNITS TO UNITS-COUNT.
IF ATWR-DESCRIPTION-COUNT IS GREATER THAN ZERO,
NEXT SENTNECE,
ELSE,
GO TO PRINT-R3-SERV-DESC.
SET TW-DESC-SUB TO 1.
PERFORM MOVE-TX-DESCRIPTION THRU MTD-EXIT,
UNTIL ATWR-DESCRIPTION-COUNT IS LESS THAN 1.
GO TO END-OF-JOURNAL-DETAIL.
MOVE-TX-DESCRIPTION.
MOVE ATWR-DESCRIPTION (TW-DESC-SUB) TO R3-TX-DESC.
SUBTRACT 1 FROM ATWR-DESCRIPTION-COUNT.
MOVE AAM020-R3-DTL3 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
MOVE SPACES TO R3-SPACE1.
MOVE SPACES TO R3-SPACE2.
SET TW-DESC-SUB UP BY 1.
PR-TX-DESC.
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MTD-EXIT.
EXIT.
PRINT-R3-SERV-DESC.
MOVE AASM-DESCRIPTION-COUNT TO MISC-COUNTER.
SET SM-DESC-SUB TO 1.
PERFORM PRINT-R3-SERVICE-DESC THRU PRSD-EXIT
UNTIL MISC-COUNTER IS LESS THAN 1.
GO TO END-OF-JOURNAL-DEATIL.
PRINT-R3-SERVICE-DESC.
MOVE AASM-DESCRIPTION (SM-DESC-SUB) TO R3-TX-DESC.
SUBTRACT 1 FROM MISC-COUNTER.
MOVE AAM020-R3-DTL2 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
MOVE SPACES TO R3-SPACE1.
MOVE SPACES TO R3-SPACE2.
SET SM-DESC-SUB UP BY 1.
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
PRSD-EXIT.
EXIT.
END-OF-JOURNAL-DETAIL.
TO TO STR-EXIT.
TX-JOURNAL-RECAP.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
MOVE SCHG-HOLD TO R3-TOTAL-CHG.
ADD SCHG-HOLD TO TOT-CUST-SERVICES.
MOVE ZEROS TO SCHG-HOLD.
MOVE TRANSACTION-COUNT TO R3-TX-TOTAL.
ADD TRANSACTION-COUNT TO TOT-CUST-TRANS.
MOVE ZEROS TO TRANSACTION-COUNT.
MOVE UNITS-COUNT TO R3-TOTAL-UNITS.
ADD UNITS-COUNT TO TOT-CUST-UNITS.
MOVE ZEROS TO UNITS-COUNT.
PRINT-CUST-TOTALS.
MOVE AAM020-R3-RCP TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACE-THREE TO SPACING
OF REPORT-TABLE (REPORT-SUB).
PRINT-NEXT-HEADING.
MOVE AAM020-R3-HD1 TO REPORT-LINE
OF REPORT-TALBE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE AAM020-R3-DTL-HD2 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
TJR-EXIT.
EXTI.
STR-EXIT.
EXIT.
DDA-EXTRACT-MAINTENANCE.
MOVE 2 TO PRINTING-CONTROL.
SET REPORT-SUB TO 2.
MOVE AAM-ACCT-NUMBER TO R2D1-ACCT-NUMBER.
MOVE AAM-SHORT-TITLE TO R2D1-SHORT-TITEL.
MOVE AAM-COLLECTED TO R2D1-COLLECTED.
MOVE AAM-AVERAGE-LEDGER TO R2D1-LEDGER.
IF DDA-TRAN-MISSING
MOVE '***MISSING***' TO R2D1-SHORT-TITEL,
PERFORM DDA-EXT-PR1 THRU DEP-EXIT,
GO TO DEM-EXIT.
MOVE EARNST TO R2D1-EARN-BAL.
MOVE AMTSCT TO R2D1-SERV-CHRGE.
MOVE LOCDEPT TO R2D1-LOCAL-ITEMS.
MOVE OTHDEPT TO R2D1-OTHER-ITEMS.
MOVE NOCRT TO R2D2-NUM-CR.
MOVE AMTCRT TO F201-AMT-CR.
MOVE NODBT TO F202-NUM-DB.
MOVE AMTDBT TO R2D2-AMT-DB.
MOVE STMTCYO TO R2D1-STMT-CYCLE.
MOVE ODT TO BINARY-BYTE.
MOVE BINARY-NUMBER-1 T R2D1-TIMES-OD.
MOVE NSFT OT BINARY-BYTE.
MOVE BINARY-NUMBER-1 TO R2D1-TIMES-NSF.
DDA-EXT-PR1.
MOVE AAM020-R2-DTL1 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
DEP-EXIT.
EXIT.
DDA-EXT-PR2.
MOVE AAM020-R2-DTL-HD3 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE AAM020-F2-DTL-HD4 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUPPUT-REPORT-RECORD THRU ORR-EXIT.
ADD 2 TO LINE-COUNT
OF REPORT-TABLE (REPORT-SUB).
MOVE AAM020-R2-DTL2 TO REPORT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT THRU ORR-EXIT.
MOVE SPACE-TWO TO SPACING
OF REPORT-TABLE (REPORT-SUB).
DEM-EXIT.
EXIT.
TRANSACTION-MAINT-REPORTING.
PROCESS-FILE-MAINT.
MOVE HIGH-VALUE TO AAM-MASTER-RECORD-PRING.
MOVE AAM-ACCT-APPL-CODE TO R1-ACCT-APPL-CODE.
MOVE AAM-ACCT-NUMBER T R1-ACCT-NUMBER.
MOVE AAM-SHORT-TITLE TO R1-SHORT-TITLE.
************************************************************************
************************************************************************
****************** INTERCEPT REPOT ONLY MAINTENANCE TRANSACTIONS *****
************************************************************************
*
IF ATWR-TRAN-CODE IS EQUAL TO 10,
MOVE 22 TO FM-CODE,
GO TO FM-REPORT.
*******
*******
IF ATWR-TRAN-CODE IS EQUAL TO 20,
MOVE 23 TO FM-CODE,
GO TO FM-REPORT.
******
IF ATWR-TRAN-CODE IS EQUAL TO 30,
MOVE 24 TO FM-CODE,
GO TO FM-REPORT.
******
IF ATWR-TRAN-CODE IS EQULA TO 40,
MOVE 25 TO FM-CODE,
GO TO FM-REPORT.
******
MOVE ATWR-TO0-FIELD TO FILE-MAINT.
MOVE ZERO TO FM-CODE.
IF ATWR-TRAN-CODE IS EQUAL TO
(170 OR,
180 OR,
190 OR,
195 OR,
200 OR,
210)
MOVE ZERO TO FM-CODE,
IF FM-AMT-2D IS NOT NUMERIC,
MOVE 8 TO REJECT-ERRORS (8),
GO TO FM-END,
IF FM-AMT-SGN IS EQUAL TO '-',
MULTIPLY -1 BY FM-AMT-2D.
IF ATWR-TRAN-CODE IS EQUAL TO 50,
MOVE 1 TO FM-CODE,
MOVE AAM-SHORT-TITLE TO R1-FIELD-FROM,
MOVE FM-SHRT-NM TO AAM-SHORT-TITLE, R1-FIELT-TO,
GO TO FM-END.
IF ATWR-TRAN-CODE IS EQUAL TO 60,
MOVE 2 TO FM-CODE,
IF FM-AREA IS NOT NUMERIC,
MOVE 8 TO REJECT-ERRORS (8),
GO TO FM-END,
ELSE,
MOVE AAM-AREA-REFERENCE TO R1-FIELD-FROM,
MOVE FM-AREA TO AAM-AREA-REFERENCE, R1-FIELD-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 70,
MOVE 3 TO FM-CODE,
IF FM-SIC IS NOT NUMBERIC
MOVE 8 TO REJECT-ERRORS (8),
GO TO FM-END,
ELSE,
MOVE AAM-S-I-C TO R1-FIELD-FROM,
MOVE FM-SIC TO AAM-S-I-C, R1-FIELD-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 80,
MOVE 4 TO FM-CODE,
IF FM-OFF IS NOT NUMERIC,
MOVE 8 TO REJECT-ERRORS (8),
GO TO FM-END,
ELSE,
MOVE AAM-OFFICER-NUMBER TO R1-FIELD-FROM,
MOVE FM-OFF TO AAM-OFFICER-NUMBER, R1-FIELD-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 90,
MOVE 5 TO FM-CODE,
IF FM-DEPT IS NOT NUMERIC,
MOVE 8 TO REJECT-ERRORS (8),
GO TO FM-END,
ELSE,
MOVE AAM-DEPARTMENT TO R1-FIELD-FROM,
MOVE FM-DEPT T AAM-DEPARTMENT, R1-FIELD-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 120,
MOVE 8 TO FM-CODE,
MOVE HIGH-VALUE TO AAM-MASTER-RECORD-PRINT,
GO TO FM-END.
IF ATWR-TRAN-CODE IS EQUAL TO 130,
MOVE 9 TO FM-CODE,
IF FM-FLAG IS NOT NUMERIC,
MOVE 8 TO REJECT-ERRORS (8),
GO TO FM-END,
ELSE,
MOVE AAM-N-A-FLAG TO R1-FIELD-FROM,
MOVE FM-FLAG TO AAM-N-A-FLAG, R1-FIELT-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 140,
MOVE 10 TO FM-CODE,
IF FM-FLAG IS NOT NUMERIC,
MOVE 8 TO REJECT-ERRORS (8),
GO TO FM-END,
ELSE,
MOVE AAM-STMT-FLAG TO R1-FIELD-FROM,
MOVE FM-FLAG TO AAM-STMT-FLAG, R1-FIELD-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 150,
MOVE 11 TO FM-CODE,
IF FM-CB IS NOT NUMERIC
MOVE 8 TO REJECT-ERRORS (8),
GO TO FM-END,
ELSE,
MOVE AAM-CB-REGION TO R1-FIELD-FROM,
MOVE FM-DEPT TO AAM-CB-REGION, R1-FIELD-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 170,
MOVE 13 TO FM-CODE,
MOVE AAM-STATEMENT-BALANCE TO R1-FIELD-FROM,
MOVE FM-AMT-2D TO AAM-STATEMENT-BALANCE, R1-FIELD-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 180,
MOVE 14 TO FM-CODE,
MOVE AAM-AVERAGE-LEDGER TO R1-FIELD-FROM,
MOVE FM-AMT-2D TO AAM-AVERAGE-LEDGER,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 190,
MOVE 15 TO FM-CODE,
MOVE AAM-INVESTIBLE TO R1-FIELD-FROM,
MOVE FM-AMT-2D TO AAM-INVESTIBLE, R1-FIELT-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 195,
MOVE 16 TO FM-CODE,
MOVE AAM-INVESTIBLE-REQ TO R1-FIELD-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 200,
MOVE 17 TO FM-CODE,
MOVE AAM-COLLECTED TO R1-FIELD-FROM,
MOVE FM-AMT-2D TO AAM-COLLECTED, R1-FIELD-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
IF ATWR-TRAN-CODE IS EQUAL TO 210,
MOVE 18 TO FM-CODE,
MOVE AAM-SERVICES TO R1-FIELD-FROM,
MOVE FM-AMT-2D TO AAM-SERVICES, R1-FIELD-TO,
GO TO FM-END,
ELSE,
NEXT SENTENCE.
INVALID-TX-CODE.
MOVE 10 TO REJECT-ERRORS (10).
GO TO FM-END.
CHANGE-HISTORY-BALANCES.
IF FM-HST-AMT SI NOT NUMERIC,
MOVE 8 TO REJECT-ERRORS (8),
GO TO FM-END.
MOVE ATWR-TRAN-CODE TO FM-TRAN-BREAK.
IF FM-SUB IS NOT LESS THAN 13 AND GREATER THAN ZERO,
MOVE 9 TO REJECT-ERRORS (9),
GO TO FM-END.
IF FM-INV,
GO TO CHANGE-INVESTIBLE-FM.
IF FM-SRV,
GO TO CHANGE-SERVICE-FM.
IF FM-REQ,
GO TO CHANGE-REQ-FM.
MOVE 10 TO REJECT-ERRORS (10).
GO TO FM-END.
CHANGE-INVESTIBEL-FM.
SET INV-SUB TO FM-SUB.
MOVE 19 TO FM-CODE.
MOVE FM-HST-AMT TO R1-FIELT-TO.
MOVE FM-HST-AMT TO AAM-INVESTIBLE-HISTORY (INV-SUB).
IF FM-HST-SGN IS EQUAL TO '-',
MULTIPLY -1 BY AAM-INVESTIBEL-HISTORY (INV-SUB).
GO TO FM-END.
CHANGE-SERVICE-FM.
SET SERV-SUB TO FM-SUB.
MOVE 20 TO FM-CODE.
MOVE AAM-SERVICE-HISTORY (SERV-SUB) TO R1-FIELD-FROM.
MOVE FM-HST-AMT TO R1-FIELD-TO, AAM-SERVICE-HISTORY (SERV-SUB).
IF FM-HST-SGN IS EQUAL TO '-',
MULTIPLY -1 BY AAM-SERVICE-HISTORY (SERV-SUB).
GO TO FM-END.
CHANGE-REQ-FM.
SET REQ-SUB TO FM-SUB.
MOVE 21 TO FM-CODE.
MOVE AAM-INV-REQ-HISTORY (REQ-SUB) TO R1-FIELD-FROM.
MOVE FM-HST-AMT TO R1-FIELD-TO, AAM-INV-REQ-HISTORY (REQ-SUB).
IF FM-HST-SGN IS EQUAL TO '-',
MULTIPLE -1 BY AAM-INV-REQ-HISTORY (REQ-SUB).
GO TO FM-END.
FM-END.
MOVE ZERO TO SRT.
PERFORM TRANSACTION-ERROR-CHECK THRU TEX-EXIT.
IF GOOD-REC,
NEXT SENTENCE,
ELSE,
MOVE ZERO TO SRT,
GO TO ATU-EXIT.
MOVE FILE-MAINT TO R1-FIELD-TO.
FM-REPORT.
MOVE 1 TO PRINTING-CONTROL.
SET REPORT-SUB TO 1.
SET FM-DESC-SUB TO FM-CODE.
MOVE FM-DESC-TABLE (FM-DESC-SUB) TO R1-FIELD-DESC.
MOVE AAM020-R1-DTL-LINE TO REPROT-LINE
OF REPORT-TABLE (REPORT-SUB).
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE SPACES TO FILE-MAINT.
MOVE SPACES TO AAM-2--R1-DTL-LINE.
GO TO TMR-EXIT.
TMR-EXIT.
EXIT.
CUSTOMER-SEARCH SECTION 10.
SET CUST-SUB TO 1.
MOVE 1 TO CUST-COUNT.
SEARCH-CUST.
IF SEARCH-USER-ID IS EQUAL TO CUST-NUMB
OF CUST-TABLE (CUST-SUB),
MOVE SEARCH-USER-ID TO PREV-USER-ID,
MOVE 1 TO CUSTOMER-FLAG.
MOVE CUST-NAME OF CUST-TABLE (CUST-SUB) TO PR-CUSTOMER.
GO TO FIND-BRANCH.
ADD 1 TO CUST-COUNT.
IF CUST-COUNT IS GREATER THAN TABLE-LIMIT,
GO TO NO-CUST-IN-TABLE.
SET CUST-SUB UP BY 1.
GO TO SEARCH-CUST.
NO-CUST-IN-TABLE.
MOVE 'DESCRIPTION MISSING' TO PR-CUSTOMER.
MOVE ZERO TO CUSTOMER-FLAG.
FIND-BRANCH.
SET BRANCH-SUB TO 1.
MOVE 1 TO BRANCH-COUNT.
SEARCH-BRNCH.
IF SEARCH-BRANCH IS EQUAL TO BREANCH-NUMB
OF BRANCH (CUST-SUB, BRANCH-SUB),
MOVE SEARCH-BRANCH TO PREV-BREANCH,
MOVE BRANCH-DESC
OF BRANCH (CUST-SUB, BREANCH-CUB) TO PR-BRANCH,
GO TO CUSTOMER-SRC-EXIT.
ADD 1 TO BRANCH-COUNT.
IF BRANCH-COUNT IS GREATER THAN NUMB-OF-BRANCHES
OF CUST-TABLE (CUST-SUB),
GO TO NO-BRANCH-IN-TABLE.
GO TO SEARCH-BRNCH.
NO-BRANCH-IN-TABLE.
MOVE 'DESCRIPTION MISSING' TO PR-BRANCH.
CUSTOMER-SRC-EXIT.
EXIT.
END-OF-POSTING.
PERFORM TX-JOURNAL-RECAP THRU PRINT-CUST-TOTALS.
SET REPORT-SUB TO 3.
MOVE ' CUSTOMER TOTALS ' TO PRINT-LINE OF REPORT-TABLE (REPORT-SUB).
MOVE 3 TO PRINTING-CONTROL.
SET REPORT-SUB TO 3.
PERFORM OUTPUT-REPORT-RECORD THRU ORR-EXIT.
MOVE TOT-CUST-SERVICES TO R3-TOTAL-CHG.
MOVE TOT-CUST-TRANS TO R3-TX-TOTAL.
MOVE TOT-CUST-UNITS TO R3-TOTAL-UNITS.
PERFORM PRINT-CUST-TOTALS.
CLOSE-ALL-FILES.
CALL 'RANDRATE' USING IO-RETURN, CLOSE-FILE.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'DDTRAN' USING IO-RETURN, CLOSE-FILE.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL'DDHIST' USING IO-RETURN, CLOSE-FILE.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'TRANWRK' USING IO-RETURN, CLOSE-FILE.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'AAHISTO' USING IO-RETURN, CLOSE-FILE.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'RPTWTR' SUING IO-RETURN, CLOSE-FILE.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'AAMRECI' USING IO-RETURN, CLOSE-FILE.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'AAMRECO' USING IO-RETURN, CLOSE-FILE.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR,
GOBACK.
CALL 'IOWORKER' USING IO-RETURN, END-OF-JOB.
IF GOOD-RETURN
NEXT SENTENCE,
ELSE
PERFORM DETERMINE-ERROR.
GOBACK.