I have to modify an existing report to allow for more than one entity. Currently we are only doing one entity at a time ex:
* P R O G R A M D E S C R I P T I O N
************************************************************************
* MONTHLY REFUND CONTROL BALANCE REPORT
************************************************************************
FILE GLACT
%GXQ0F085
*
FILE GLSUM
DEFINE GL-PFFS-IND 1 1 A
DEFINE GL-BUS-DATE 2 10 A
DEFINE GL-TALLY 12 10 P 0
DEFINE GL-TRD-CLM-REF 22 10 P 2
DEFINE GL-MPASO-CLM-REF 32 10 P 2
DEFINE GL-TOTAL-CLM-REF 42 10 P 2
DEFINE GL-LPI-REF 52 10 P 2
DEFINE GL-TOT-REF 62 10 P 2
*
FILE GLQTYIN
DEFINE GLQ-FILLER-1 1 10 A
DEFINE GLQ-CLM-ISS-A 11 11 N 2
DEFINE GLQ-FILLER-2 22 2 A
DEFINE GLQ-CLM-REV-V-A 24 11 N 2
DEFINE GLQ-FILLER-3 35 2 A
DEFINE GLQ-CLM-REV-S-A 37 11 N 2
DEFINE GLQ-FILLER-4 48 2 A
DEFINE GLQ-TOT-CLM-REF 50 8 N 2
DEFINE GLQ-FILLER-5 58 22 A
*
FILE GLQTYOUT
DEFINE GLQ-OUT-FILLER-1 1 80 A
*
FILE OUTRPT1 PRINTER FB (81 0)
FILE OUTRPT2 PRINTER FB (81 0)
************************************************************************
** WORKING STORAGE VARIABLES
************************************************************************
WS-F085 W 160 A
WS-F085-C-MM WS-F085 +10 2 A
WS-F085-C-DD WS-F085 +12 2 A
WS-F085-C-YY WS-F085 +14 2 A
WS-B-DATE W 10 A
WS-B-MM WS-B-DATE 2 A
WS-B-S1 WS-B-DATE +02 1 A VALUE '/'
WS-B-DD WS-B-DATE +03 2 A
WS-B-S2 WS-B-DATE +05 1 A VALUE '/'
WS-B-CC WS-B-DATE +06 2 A
WS-B-YY WS-B-DATE +08 2 A
WS-INPUT-DATA-E W 1 A VALUE 'N'.
WS-INPUT-DATA-L W 1 A VALUE 'N'.
WS-VALID-DATA W 1 A VALUE 'N'.
WS-INPUT-FIRST-LINE W 1 A VALUE 'Y'.
WS-INPUT-DATE W 8 A
WS-INPUT-MM WS-INPUT-DATE 2 A
WS-INPUT-S1 WS-INPUT-DATE +02 1 A VALUE '/'
WS-INPUT-DD WS-INPUT-DATE +03 2 A
WS-INPUT-S2 WS-INPUT-DATE +05 1 A VALUE '/'
WS-INPUT-YY WS-INPUT-DATE +06 2 A
WS-PFFS-SW W 1 A
WS-PFFS-PRESENT-SW S 1 A VALUE 'N'
WS-NON-PFFS-PRESENT-SW S 1 A VALUE 'N'
WS-1ST-BEFORE-BREAK-SW S 1 A VALUE 'Y'
DEFINE WS-NO-DATA-MSG W 40 A HEADING(' ')
DEFINE WS-BUS-DATE W 10 A HEADING('BUSINESS' 'DATE '
DEFINE WS-TRD-CLM-REF W 4 P 2 +
HEADING('TRADITIONAL' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS-MPASO-CLM-REF W 4 P 2 +
HEADING('MP/ASO' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS-TOTAL-CLM-REF W 4 P 2 +
HEADING('TOTAL' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS-LPI-REF W 4 P 2 +
HEADING('LPI' 'REFUNDS') +
MASK('--,--9.99')
DEFINE WS-TOT-REF W 4 P 2 +
HEADING('TOTAL' 'REFUNDS') +
MASK('--,--9.99')
DEFINE WS2-TRD-CLM-REF W 4 P 2 +
HEADING('TRADITIONAL' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS2-MPASO-CLM-REF W 4 P 2 +
HEADING('MP/ASO' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS2-TOTAL-CLM-REF W 4 P 2 +
HEADING('TOTAL' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS2-LPI-REF W 4 P 2 +
HEADING('LPI' 'REFUNDS') +
MASK('--,--9.99')
DEFINE WS2-TOT-REF W 4 P 2 +
HEADING('TOTAL' 'REFUNDS') +
MASK('--,--9.99')
JOB INPUT GLACT FINISH THE-END
IF WS-INPUT-FIRST-LINE = 'Y'
WS-F085 = F085-GL-ACTIVITY-RCD
WS-INPUT-MM = WS-F085-C-MM
WS-INPUT-DD = WS-F085-C-DD
WS-INPUT-YY = WS-F085-C-YY
WS-INPUT-FIRST-LINE = 'N'
ELSE
IF F085-ACCOUNT-NUMBER EQ '2470534'
WS-PFFS-SW = '2'
IF F085-TRANS-TYPE = '4'
WS-PFFS-PRESENT-SW = 'Y'
END-IF
ELSE
WS-PFFS-SW = '1'
END-IF
WS-B-MM = F085-CYCLE-MM
WS-B-DD = F085-CYCLE-DD
WS-B-CC = F085-CYCLE-CC
WS-B-YY = F085-CYCLE-YY
WS-BUS-DATE = WS-B-DATE
WS-TRD-CLM-REF = 0
WS-MPASO-CLM-REF = 0
WS-TOTAL-CLM-REF = 0
WS-LPI-REF = 0
WS-TOT-REF = 0
WS-VALID-DATA = 'N'
PERFORM CHECK-CONDITION
IF WS-VALID-DATA = 'Y'
IF F085-TRANS-MIGRTN-CODE = 'M' OR F085-TRANS-MIGRTN-CODE = 'N'
WS-INPUT-DATA-E = 'Y'
IF F085-ACCOUNT-NUMBER NE '2470534'
WS-NON-PFFS-PRESENT-SW = 'Y'
END-IF
PRINT RPT1
ELSE
IF F085-TRANS-MIGRTN-CODE = 'E'
WS-INPUT-DATA-L = 'Y'
PRINT RPT3
END-IF
END-IF
END-IF
END-IF.
GOTO JOB
CHECK-CONDITION. PROC
IF F085-TRANS-TYPE = '4'
IF F085-CLM-REASON-CODE NE 'IF'
IF F085-FUND-TYPE = '1'
WS-TRD-CLM-REF = F085-FIN-TRANS-AMT
WS-TOTAL-CLM-REF = F085-FIN-TRANS-AMT
WS-TOT-REF = F085-FIN-TRANS-AMT
WS-VALID-DATA = 'Y'
ELSE
IF F085-FUND-TYPE = '0' '8' '2'
WS-MPASO-CLM-REF = F085-FIN-TRANS-AMT
WS-TOTAL-CLM-REF = F085-FIN-TRANS-AMT
WS-TOT-REF = F085-FIN-TRANS-AMT
WS-VALID-DATA = 'Y'
END-IF
END-IF
ELSE
IF F085-CLM-REASON-CODE EQ 'IF'
IF F085-FUND-TYPE = '1'
WS-LPI-REF = F085-FIN-TRANS-AMT
WS-TOT-REF = F085-FIN-TRANS-AMT
WS-VALID-DATA = 'Y'
END-IF
END-IF
END-IF
END-IF
END-PROC.
THE-END. PROC
IF WS-INPUT-DATA-E = 'N'
WS-NO-DATA-MSG = ' *** NO END STATE REFUND DATA '
PRINT RPT2
END-IF
IF WS-INPUT-DATA-L = 'N'
WS-NO-DATA-MSG = ' *** NO LEGACY REFUND DATA '
PRINT RPT4
END-IF
END-PROC.
REPORT RPT1 SUMMARY SUMFILE GLSUM +
NODATE LINESIZE 80 NOADJUST SPACE 1 NOSPREAD +
PRINTER OUTRPT1
SEQUENCE WS-PFFS-SW WS-BUS-DATE
CONTROL FINAL NOPRINT WS-PFFS-SW NOPRINT WS-BUS-DATE
SUM WS-TRD-CLM-REF WS-MPASO-CLM-REF WS-TOTAL-CLM-REF +
WS-LPI-REF WS-TOT-REF
TITLE 01 COL 02 'REPORT #: GXQM86A ' COL 35 'DENTACOM'
TITLE 02 COL 02 'CYCLE DATE: ' COL 14 WS-INPUT-DATE +
COL 61 'RUN DATE: ' COL 72 SYSDATE
TITLE 03 COL 32 'MONTHLY REFUND'
TITLE 04 COL 28 'CONTROL BALANCE REPORT'
TITLE 05 COL 34 'END STATE'
TITLE 06 COL 02 'REPORTING MONTH : ' COL 20 WS-INPUT- TITLE 07 ' '
LINE 1 WS-BUS-DATE +
WS-TRD-CLM-REF WS-MPASO-CLM-REF WS-TOTAL-CLM-REF +
WS-LPI-REF WS-TOT-REF
BEFORE-BREAK. PROC
IF WS-1ST-BEFORE-BREAK-SW = 'Y'
DISPLAY ' NON-MEDICARE '
IF WS-NON-PFFS-PRESENT-SW = 'N'
WS2-TRD-CLM-REF = 0
WS2-MPASO-CLM-REF = 0
WS2-TOTAL-CLM-REF = 0
WS2-LPI-REF = 0
WS2-TOT-REF = 0
DISPLAY ' '
DISPLAY 'TOTAL NONM ' +
' ' WS2-TRD-CLM-REF ' ' WS2-MPASO-CLM-REF +
' ' WS2-TOTAL-CLM-REF ' ' WS2-LPI-REF +
' ' WS2-TOT-REF
DISPLAY ' '
DISPLAY 'MEDICARE'
DISPLAY ' '
END-IF
END-IF
END-PROC.
AFTER-BREAK. PROC
WS-1ST-BEFORE-BREAK-SW = 'N'
IF LEVEL EQ 2
IF WS-PFFS-SW = '1'
DISPLAY ' '
DISPLAY 'TOTAL NONM' +
' ' WS-TRD-CLM-REF ' ' WS-MPASO-CLM-REF ' ' WS-TOTAL-CLM-REF +
' ' WS-LPI-REF ' ' WS-TOT-REF
DISPLAY ' '
DISPLAY 'MEDICARE'
ELSE
DISPLAY ' '
DISPLAY 'TOTAL MED ' +
' ' WS-TRD-CLM-REF ' ' WS-MPASO-CLM-REF ' ' WS-TOTAL-CLM-REF +
' ' WS-LPI-REF ' ' WS-TOT-REF
DISPLAY ' '
DISPLAY 'TOTAL'
DISPLAY ' '
END-IF
END-IF
END-PROC.
TERMINATION. PROC
IF WS-PFFS-PRESENT-SW = 'N'
WS-TRD-CLM-REF = 0
WS-MPASO-CLM-REF = 0
WS-TOTAL-CLM-REF = 0
WS-LPI-REF = 0
WS-TOT-REF = 0
DISPLAY ' '
DISPLAY 'TOTAL MED ' +
' ' WS-TRD-CLM-REF ' ' WS-MPASO-CLM-REF ' ' WS-TOTAL-CLM-REF +
' ' WS-LPI-REF ' ' WS-TOT-REF
DISPLAY ' '
DISPLAY 'TOTAL'
DISPLAY ' '
END-IF
END-PROC.
REPORT RPT2 NODATE LINESIZE 80 NOADJUST +
PRINTER OUTRPT1
TITLE 01 COL 02 'REPORT #: GXQM86A ' COL 35 'DENTACOM'
TITLE 02 COL 02 'CYCLE DATE: ' COL 14 WS-INPUT-DATE +
COL 61 'RUN DATE: ' COL 72 SYSDATE
TITLE 03 COL 32 'MONTHLY REFUND'
TITLE 04 COL 28 'CONTROL BALANCE REPORT'
TITLE 05 COL 34 'END STATE'
TITLE 06 COL 02 'REPORTING MONTH : ' COL 20 WS-INPUT-MM
TITLE 07 ' '
LINE 1 WS-NO-DATA-MSG
REPORT RPT3 SUMMARY NODATE LINESIZE 80 NOADJUST SPACE 1 NOSPREAD +
PRINTER OUTRPT2
SEQUENCE WS-BUS-DATE
CONTROL FINAL NOPRINT WS-BUS-DATE
SUM WS-TRD-CLM-REF WS-MPASO-CLM-REF WS-TOTAL-CLM-REF +
WS-LPI-REF WS-TOT-REF
TITLE 01 COL 02 'REPORT #: GXQM86B ' COL 35 'DENTACOM'
TITLE 02 COL 02 'CYCLE DATE: ' COL 14 WS-INPUT-DATE +
COL 61 'RUN DATE: ' COL 72 SYSDATE
TITLE 03 COL 32 'MONTHLY REFUND'
TITLE 04 COL 28 'CONTROL BALANCE REPORT'
TITLE 05 COL 36 'LEGACY'
TITLE 06 COL 02 'REPORTING MONTH : ' COL 20 WS-INPUT-MM
TITLE 07 ' '
LINE 1 WS-BUS-DATE +
WS-TRD-CLM-REF WS-MPASO-CLM-REF WS-TOTAL-CLM-REF +
WS-LPI-REF WS-TOT-REF
AFTER-BREAK. PROC
IF LEVEL EQ 2
DISPLAY ' '
DISPLAY 'TOTALS ' +
' ' WS-TRD-CLM-REF ' ' WS-MPASO-CLM-REF ' ' WS-TOTAL-CLM-REF +
' ' WS-LPI-REF ' ' WS-TOT-REF
END-IF
END-PROC.
REPORT RPT4 NODATE LINESIZE 80 NOADJUST +
PRINTER OUTRPT2
TITLE 01 COL 02 'REPORT #: GXQM86B ' COL 35 'DENTACOM'
TITLE 02 COL 02 'CYCLE DATE: ' COL 14 WS-INPUT-DATE +
COL 61 'RUN DATE: ' COL 72 SYSDATE
TITLE 03 COL 32 'MONTHLY REFUND'
TITLE 04 COL 28 'CONTROL BALANCE REPORT'
TITLE 05 COL 36 'LEGACY'
TITLE 06 COL 02 'REPORTING MONTH : ' COL 20 WS-INPUT-MM
TITLE 07 ' '
LINE 1 WS-NO-DATA-MSG
JOB INPUT GLSUM START BEGIN FINISH THE-END2
DEFINE GLT-TRD-CLM-REF W 8 N 2 +
MASK('---,--9.99')
DEFINE GLT-MPASO-CLM-REF W 8 N 2 +
MASK('---,--9.99')
DEFINE GLT-TOTAL-CLM-REF W 8 N 2 +
MASK('---,--9.99')
DEFINE GLT-LPI-REF W 8 N 2 +
MASK('---,--9.99')
DEFINE GLT-TOT-REF W 8 N 2 +
MASK('---,--9.99')
GLT-TRD-CLM-REF = GL-TRD-CLM-REF
GLT-MPASO-CLM-REF = GL-MPASO-CLM-REF
GLT-TOTAL-CLM-REF = GL-TOTAL-CLM-REF
GLT-LPI-REF = GL-LPI-REF
GLT-TOT-REF = GL-TOT-REF
IF GL-PFFS-IND = '2'
GLQ-TOT-CLM-REF = GLQ-TOT-CLM-REF + GL-TOTAL-CLM-REF
END-IF
PRINT RPT5
GOTO JOB
BEGIN. PROC
GET GLQTYIN
END-PROC.
THE-END2. PROC
PUT GLQTYOUT FROM GLQTYIN
END-PROC.
REPORT RPT5 SUMMARY NODATE LINESIZE 80 NOADJUST SPACE 0 NOSPREAD +
NOHEADING PRINTER OUTRPT1
SEQUENCE GL-BUS-DATE
CONTROL FINAL NOPRINT GL-BUS-DATE
SUM GLT-TRD-CLM-REF GLT-MPASO-CLM-REF GLT-TOTAL-CLM-REF +
GLT-LPI-REF GLT-TOT-REF
LINE 1 GL-BUS-DATE GLT-TRD-CLM-REF GLT-MPASO-CLM-REF +
GLT-TOTAL-CLM-REF GLT-LPI-REF GLT-TOT-REF
AFTER-BREAK. PROC
IF LEVEL EQ 2
DISPLAY ' '
DISPLAY 'TOTALS ' +
GLT-TRD-CLM-REF GLT-MPASO-CLM-REF GLT-TOTAL-CLM-REF +
GLT-LPI-REF GLT-TOT-REF
END-IF
END-PROC.
%GXQ0F085
*
FILE GLSUM
DEFINE GL-PFFS-IND 1 1 A
DEFINE GL-BUS-DATE 2 10 A
DEFINE GL-TALLY 12 10 P 0
DEFINE GL-TRD-CLM-REF 22 10 P 2
DEFINE GL-MPASO-CLM-REF 32 10 P 2
DEFINE GL-TOTAL-CLM-REF 42 10 P 2
DEFINE GL-LPI-REF 52 10 P 2
DEFINE GL-TOT-REF 62 10 P 2
*
FILE GLQTYIN
DEFINE GLQ-FILLER-1 1 10 A
DEFINE GLQ-CLM-ISS-A 11 11 N 2
DEFINE GLQ-FILLER-2 22 2 A
DEFINE GLQ-CLM-REV-V-A 24 11 N 2
DEFINE GLQ-FILLER-3 35 2 A
DEFINE GLQ-CLM-REV-S-A 37 11 N 2
DEFINE GLQ-FILLER-4 48 2 A
DEFINE GLQ-TOT-CLM-REF 50 8 N 2
DEFINE GLQ-FILLER-5 58 22 A
*
FILE GLQTYOUT
DEFINE GLQ-OUT-FILLER-1 1 80 A
*
FILE OUTRPT1 PRINTER FB (81 0)
FILE OUTRPT2 PRINTER FB (81 0)
************************************************************************
** WORKING STORAGE VARIABLES
************************************************************************
WS-F085 W 160 A
WS-F085-C-MM WS-F085 +10 2 A
WS-F085-C-DD WS-F085 +12 2 A
WS-F085-C-YY WS-F085 +14 2 A
WS-B-DATE W 10 A
WS-B-MM WS-B-DATE 2 A
WS-B-S1 WS-B-DATE +02 1 A VALUE '/'
WS-B-DD WS-B-DATE +03 2 A
WS-B-S2 WS-B-DATE +05 1 A VALUE '/'
WS-B-CC WS-B-DATE +06 2 A
WS-B-YY WS-B-DATE +08 2 A
WS-INPUT-DATA-E W 1 A VALUE 'N'.
WS-INPUT-DATA-L W 1 A VALUE 'N'.
WS-VALID-DATA W 1 A VALUE 'N'.
WS-INPUT-FIRST-LINE W 1 A VALUE 'Y'.
WS-INPUT-DATE W 8 A
WS-INPUT-MM WS-INPUT-DATE 2 A
WS-INPUT-S1 WS-INPUT-DATE +02 1 A VALUE '/'
WS-INPUT-DD WS-INPUT-DATE +03 2 A
WS-INPUT-S2 WS-INPUT-DATE +05 1 A VALUE '/'
WS-INPUT-YY WS-INPUT-DATE +06 2 A
WS-PFFS-SW W 1 A
WS-PFFS-PRESENT-SW S 1 A VALUE 'N'
WS-NON-PFFS-PRESENT-SW S 1 A VALUE 'N'
WS-1ST-BEFORE-BREAK-SW S 1 A VALUE 'Y'
DEFINE WS-NO-DATA-MSG W 40 A HEADING(' ')
DEFINE WS-BUS-DATE W 10 A HEADING('BUSINESS' 'DATE '
DEFINE WS-TRD-CLM-REF W 4 P 2 +
HEADING('TRADITIONAL' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS-MPASO-CLM-REF W 4 P 2 +
HEADING('MP/ASO' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS-TOTAL-CLM-REF W 4 P 2 +
HEADING('TOTAL' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS-LPI-REF W 4 P 2 +
HEADING('LPI' 'REFUNDS') +
MASK('--,--9.99')
DEFINE WS-TOT-REF W 4 P 2 +
HEADING('TOTAL' 'REFUNDS') +
MASK('--,--9.99')
DEFINE WS2-TRD-CLM-REF W 4 P 2 +
HEADING('TRADITIONAL' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS2-MPASO-CLM-REF W 4 P 2 +
HEADING('MP/ASO' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS2-TOTAL-CLM-REF W 4 P 2 +
HEADING('TOTAL' 'CLAIM REFUNDS') +
MASK('--,--9.99')
DEFINE WS2-LPI-REF W 4 P 2 +
HEADING('LPI' 'REFUNDS') +
MASK('--,--9.99')
DEFINE WS2-TOT-REF W 4 P 2 +
HEADING('TOTAL' 'REFUNDS') +
MASK('--,--9.99')
JOB INPUT GLACT FINISH THE-END
IF WS-INPUT-FIRST-LINE = 'Y'
WS-F085 = F085-GL-ACTIVITY-RCD
WS-INPUT-MM = WS-F085-C-MM
WS-INPUT-DD = WS-F085-C-DD
WS-INPUT-YY = WS-F085-C-YY
WS-INPUT-FIRST-LINE = 'N'
ELSE
IF F085-ACCOUNT-NUMBER EQ '2470534'
WS-PFFS-SW = '2'
IF F085-TRANS-TYPE = '4'
WS-PFFS-PRESENT-SW = 'Y'
END-IF
ELSE
WS-PFFS-SW = '1'
END-IF
WS-B-MM = F085-CYCLE-MM
WS-B-DD = F085-CYCLE-DD
WS-B-CC = F085-CYCLE-CC
WS-B-YY = F085-CYCLE-YY
WS-BUS-DATE = WS-B-DATE
WS-TRD-CLM-REF = 0
WS-MPASO-CLM-REF = 0
WS-TOTAL-CLM-REF = 0
WS-LPI-REF = 0
WS-TOT-REF = 0
WS-VALID-DATA = 'N'
PERFORM CHECK-CONDITION
IF WS-VALID-DATA = 'Y'
IF F085-TRANS-MIGRTN-CODE = 'M' OR F085-TRANS-MIGRTN-CODE = 'N'
WS-INPUT-DATA-E = 'Y'
IF F085-ACCOUNT-NUMBER NE '2470534'
WS-NON-PFFS-PRESENT-SW = 'Y'
END-IF
PRINT RPT1
ELSE
IF F085-TRANS-MIGRTN-CODE = 'E'
WS-INPUT-DATA-L = 'Y'
PRINT RPT3
END-IF
END-IF
END-IF
END-IF.
GOTO JOB
CHECK-CONDITION. PROC
IF F085-TRANS-TYPE = '4'
IF F085-CLM-REASON-CODE NE 'IF'
IF F085-FUND-TYPE = '1'
WS-TRD-CLM-REF = F085-FIN-TRANS-AMT
WS-TOTAL-CLM-REF = F085-FIN-TRANS-AMT
WS-TOT-REF = F085-FIN-TRANS-AMT
WS-VALID-DATA = 'Y'
ELSE
IF F085-FUND-TYPE = '0' '8' '2'
WS-MPASO-CLM-REF = F085-FIN-TRANS-AMT
WS-TOTAL-CLM-REF = F085-FIN-TRANS-AMT
WS-TOT-REF = F085-FIN-TRANS-AMT
WS-VALID-DATA = 'Y'
END-IF
END-IF
ELSE
IF F085-CLM-REASON-CODE EQ 'IF'
IF F085-FUND-TYPE = '1'
WS-LPI-REF = F085-FIN-TRANS-AMT
WS-TOT-REF = F085-FIN-TRANS-AMT
WS-VALID-DATA = 'Y'
END-IF
END-IF
END-IF
END-IF
END-PROC.
THE-END. PROC
IF WS-INPUT-DATA-E = 'N'
WS-NO-DATA-MSG = ' *** NO END STATE REFUND DATA '
PRINT RPT2
END-IF
IF WS-INPUT-DATA-L = 'N'
WS-NO-DATA-MSG = ' *** NO LEGACY REFUND DATA '
PRINT RPT4
END-IF
END-PROC.
REPORT RPT1 SUMMARY SUMFILE GLSUM +
NODATE LINESIZE 80 NOADJUST SPACE 1 NOSPREAD +
PRINTER OUTRPT1
SEQUENCE WS-PFFS-SW WS-BUS-DATE
CONTROL FINAL NOPRINT WS-PFFS-SW NOPRINT WS-BUS-DATE
SUM WS-TRD-CLM-REF WS-MPASO-CLM-REF WS-TOTAL-CLM-REF +
WS-LPI-REF WS-TOT-REF
TITLE 01 COL 02 'REPORT #: GXQM86A ' COL 35 'DENTACOM'
TITLE 02 COL 02 'CYCLE DATE: ' COL 14 WS-INPUT-DATE +
COL 61 'RUN DATE: ' COL 72 SYSDATE
TITLE 03 COL 32 'MONTHLY REFUND'
TITLE 04 COL 28 'CONTROL BALANCE REPORT'
TITLE 05 COL 34 'END STATE'
TITLE 06 COL 02 'REPORTING MONTH : ' COL 20 WS-INPUT- TITLE 07 ' '
LINE 1 WS-BUS-DATE +
WS-TRD-CLM-REF WS-MPASO-CLM-REF WS-TOTAL-CLM-REF +
WS-LPI-REF WS-TOT-REF
BEFORE-BREAK. PROC
IF WS-1ST-BEFORE-BREAK-SW = 'Y'
DISPLAY ' NON-MEDICARE '
IF WS-NON-PFFS-PRESENT-SW = 'N'
WS2-TRD-CLM-REF = 0
WS2-MPASO-CLM-REF = 0
WS2-TOTAL-CLM-REF = 0
WS2-LPI-REF = 0
WS2-TOT-REF = 0
DISPLAY ' '
DISPLAY 'TOTAL NONM ' +
' ' WS2-TRD-CLM-REF ' ' WS2-MPASO-CLM-REF +
' ' WS2-TOTAL-CLM-REF ' ' WS2-LPI-REF +
' ' WS2-TOT-REF
DISPLAY ' '
DISPLAY 'MEDICARE'
DISPLAY ' '
END-IF
END-IF
END-PROC.
AFTER-BREAK. PROC
WS-1ST-BEFORE-BREAK-SW = 'N'
IF LEVEL EQ 2
IF WS-PFFS-SW = '1'
DISPLAY ' '
DISPLAY 'TOTAL NONM' +
' ' WS-TRD-CLM-REF ' ' WS-MPASO-CLM-REF ' ' WS-TOTAL-CLM-REF +
' ' WS-LPI-REF ' ' WS-TOT-REF
DISPLAY ' '
DISPLAY 'MEDICARE'
ELSE
DISPLAY ' '
DISPLAY 'TOTAL MED ' +
' ' WS-TRD-CLM-REF ' ' WS-MPASO-CLM-REF ' ' WS-TOTAL-CLM-REF +
' ' WS-LPI-REF ' ' WS-TOT-REF
DISPLAY ' '
DISPLAY 'TOTAL'
DISPLAY ' '
END-IF
END-IF
END-PROC.
TERMINATION. PROC
IF WS-PFFS-PRESENT-SW = 'N'
WS-TRD-CLM-REF = 0
WS-MPASO-CLM-REF = 0
WS-TOTAL-CLM-REF = 0
WS-LPI-REF = 0
WS-TOT-REF = 0
DISPLAY ' '
DISPLAY 'TOTAL MED ' +
' ' WS-TRD-CLM-REF ' ' WS-MPASO-CLM-REF ' ' WS-TOTAL-CLM-REF +
' ' WS-LPI-REF ' ' WS-TOT-REF
DISPLAY ' '
DISPLAY 'TOTAL'
DISPLAY ' '
END-IF
END-PROC.
REPORT RPT2 NODATE LINESIZE 80 NOADJUST +
PRINTER OUTRPT1
TITLE 01 COL 02 'REPORT #: GXQM86A ' COL 35 'DENTACOM'
TITLE 02 COL 02 'CYCLE DATE: ' COL 14 WS-INPUT-DATE +
COL 61 'RUN DATE: ' COL 72 SYSDATE
TITLE 03 COL 32 'MONTHLY REFUND'
TITLE 04 COL 28 'CONTROL BALANCE REPORT'
TITLE 05 COL 34 'END STATE'
TITLE 06 COL 02 'REPORTING MONTH : ' COL 20 WS-INPUT-MM
TITLE 07 ' '
LINE 1 WS-NO-DATA-MSG
REPORT RPT3 SUMMARY NODATE LINESIZE 80 NOADJUST SPACE 1 NOSPREAD +
PRINTER OUTRPT2
SEQUENCE WS-BUS-DATE
CONTROL FINAL NOPRINT WS-BUS-DATE
SUM WS-TRD-CLM-REF WS-MPASO-CLM-REF WS-TOTAL-CLM-REF +
WS-LPI-REF WS-TOT-REF
TITLE 01 COL 02 'REPORT #: GXQM86B ' COL 35 'DENTACOM'
TITLE 02 COL 02 'CYCLE DATE: ' COL 14 WS-INPUT-DATE +
COL 61 'RUN DATE: ' COL 72 SYSDATE
TITLE 03 COL 32 'MONTHLY REFUND'
TITLE 04 COL 28 'CONTROL BALANCE REPORT'
TITLE 05 COL 36 'LEGACY'
TITLE 06 COL 02 'REPORTING MONTH : ' COL 20 WS-INPUT-MM
TITLE 07 ' '
LINE 1 WS-BUS-DATE +
WS-TRD-CLM-REF WS-MPASO-CLM-REF WS-TOTAL-CLM-REF +
WS-LPI-REF WS-TOT-REF
AFTER-BREAK. PROC
IF LEVEL EQ 2
DISPLAY ' '
DISPLAY 'TOTALS ' +
' ' WS-TRD-CLM-REF ' ' WS-MPASO-CLM-REF ' ' WS-TOTAL-CLM-REF +
' ' WS-LPI-REF ' ' WS-TOT-REF
END-IF
END-PROC.
REPORT RPT4 NODATE LINESIZE 80 NOADJUST +
PRINTER OUTRPT2
TITLE 01 COL 02 'REPORT #: GXQM86B ' COL 35 'DENTACOM'
TITLE 02 COL 02 'CYCLE DATE: ' COL 14 WS-INPUT-DATE +
COL 61 'RUN DATE: ' COL 72 SYSDATE
TITLE 03 COL 32 'MONTHLY REFUND'
TITLE 04 COL 28 'CONTROL BALANCE REPORT'
TITLE 05 COL 36 'LEGACY'
TITLE 06 COL 02 'REPORTING MONTH : ' COL 20 WS-INPUT-MM
TITLE 07 ' '
LINE 1 WS-NO-DATA-MSG
JOB INPUT GLSUM START BEGIN FINISH THE-END2
DEFINE GLT-TRD-CLM-REF W 8 N 2 +
MASK('---,--9.99')
DEFINE GLT-MPASO-CLM-REF W 8 N 2 +
MASK('---,--9.99')
DEFINE GLT-TOTAL-CLM-REF W 8 N 2 +
MASK('---,--9.99')
DEFINE GLT-LPI-REF W 8 N 2 +
MASK('---,--9.99')
DEFINE GLT-TOT-REF W 8 N 2 +
MASK('---,--9.99')
GLT-TRD-CLM-REF = GL-TRD-CLM-REF
GLT-MPASO-CLM-REF = GL-MPASO-CLM-REF
GLT-TOTAL-CLM-REF = GL-TOTAL-CLM-REF
GLT-LPI-REF = GL-LPI-REF
GLT-TOT-REF = GL-TOT-REF
IF GL-PFFS-IND = '2'
GLQ-TOT-CLM-REF = GLQ-TOT-CLM-REF + GL-TOTAL-CLM-REF
END-IF
PRINT RPT5
GOTO JOB
BEGIN. PROC
GET GLQTYIN
END-PROC.
THE-END2. PROC
PUT GLQTYOUT FROM GLQTYIN
END-PROC.
REPORT RPT5 SUMMARY NODATE LINESIZE 80 NOADJUST SPACE 0 NOSPREAD +
NOHEADING PRINTER OUTRPT1
SEQUENCE GL-BUS-DATE
CONTROL FINAL NOPRINT GL-BUS-DATE
SUM GLT-TRD-CLM-REF GLT-MPASO-CLM-REF GLT-TOTAL-CLM-REF +
GLT-LPI-REF GLT-TOT-REF
LINE 1 GL-BUS-DATE GLT-TRD-CLM-REF GLT-MPASO-CLM-REF +
GLT-TOTAL-CLM-REF GLT-LPI-REF GLT-TOT-REF
AFTER-BREAK. PROC
IF LEVEL EQ 2
DISPLAY ' '
DISPLAY 'TOTALS ' +
GLT-TRD-CLM-REF GLT-MPASO-CLM-REF GLT-TOTAL-CLM-REF +
GLT-LPI-REF GLT-TOT-REF
END-IF
END-PROC.
We have tried to add logic to make this break by entity and put out the contents of report 5 after each entity break and no longer put out report 5 at the end of the job but no matter what we try it doesn't work
Any ideas would be apprecitated