I am using the below CONTROL statement to break fields. But i am unable to break all fields in resulted output file. My code and result is posted below.
CONTROL FINAL NOPRINT YEAR NOPRINT NEWPAGE RP-CD NOPRINT -
CNS-CD NOPRINT
*
LINE 01 COL 02 RP-CD, -
COL 06 CNS-CD
*
AFTER-BREAK. PROC
IF LEVEL = 1
DISPLAY COL 2 '**************' END-IF
IF LEVEL = 2
DISPLAY COL 2 '--------------' END-IF
IF LEVEL = 3
DISPLAY COL 2 '$$$$$$$$$$$$$' END-IF
CNS-CD NOPRINT
*
LINE 01 COL 02 RP-CD, -
COL 06 CNS-CD
*
AFTER-BREAK. PROC
IF LEVEL = 1
DISPLAY COL 2 '**************' END-IF
IF LEVEL = 2
DISPLAY COL 2 '--------------' END-IF
IF LEVEL = 3
DISPLAY COL 2 '$$$$$$$$$$$$$' END-IF
The output result is comes like below:
************************ PAGE:1
************************
REPORT# REPORT NAME
HOURS FOR YEAR: 1995
RP-CD CNS CD
----- -------
ALL
**************
--------------
601
**************
601 AAAAAAA
**************
--------------
602
**************
602 BBBBBBB
**************
602 CCCCCCCC
**************
602 DDDDDDDD
**************
602 EEEEEEEE
--------------
$$$$$$$$$$$$$
************************ PAGE:2
************************
REPORT# REPORT NAME
HOURS FOR YEAR: 1996
**************
603 AAAAAAAA
**************
603 BBBBBBBB
**************
603 CCCCCCCC
CCCCCCCC
**************
603 DDDDDDDD
**************
603 EEEEEEEE
**************
--------------
604
**************
604 AAAAAAAA
**************
604 HHHHHHHH
**************
--------------
************************
REPORT# REPORT NAME
HOURS FOR YEAR: 1995
RP-CD CNS CD
----- -------
ALL
**************
--------------
601
**************
601 AAAAAAA
**************
--------------
602
**************
602 BBBBBBB
**************
602 CCCCCCCC
**************
602 DDDDDDDD
**************
602 EEEEEEEE
--------------
$$$$$$$$$$$$$
************************ PAGE:2
************************
REPORT# REPORT NAME
HOURS FOR YEAR: 1996
**************
603 AAAAAAAA
**************
603 BBBBBBBB
**************
603 CCCCCCCC
CCCCCCCC
**************
603 DDDDDDDD
**************
603 EEEEEEEE
**************
--------------
604
**************
604 AAAAAAAA
**************
604 HHHHHHHH
**************
--------------
But i am expecting the result like below. Can you please assist me on this.
************************ PAGE:1
************************
REPORT# REPORT NAME
HOURS FOR YEAR: 1995
RP-CD CNS CD
----- -------
ALL
**************
--------------
601
**************
AAAAAAA
**************
--------------
602
**************
BBBBBBB
**************
CCCCCCCC
**************
DDDDDDDD
**************
EEEEEEEE
--------------
$$$$$$$$$$$$$
************************ PAGE:2
************************
REPORT# REPORT NAME
HOURS FOR YEAR: 1996
**************
603 AAAAAAAA
**************
BBBBBBBB
**************
CCCCCCCC
CCCCCCCC
**************
DDDDDDDD
**************
EEEEEEEE
**************
--------------
604
**************
AAAAAAAA
**************
HHHHHHHH
**************
--------------
************************
REPORT# REPORT NAME
HOURS FOR YEAR: 1995
RP-CD CNS CD
----- -------
ALL
**************
--------------
601
**************
AAAAAAA
**************
--------------
602
**************
BBBBBBB
**************
CCCCCCCC
**************
DDDDDDDD
**************
EEEEEEEE
--------------
$$$$$$$$$$$$$
************************ PAGE:2
************************
REPORT# REPORT NAME
HOURS FOR YEAR: 1996
**************
603 AAAAAAAA
**************
BBBBBBBB
**************
CCCCCCCC
CCCCCCCC
**************
DDDDDDDD
**************
EEEEEEEE
**************
--------------
604
**************
AAAAAAAA
**************
HHHHHHHH
**************
--------------