View previous topic :: View next topic |
Author |
Message |
rg_nath Beginner
Joined: 03 Jul 2015 Posts: 23 Topics: 7
|
Posted: Tue Sep 08, 2015 5:07 am Post subject: Carriage Control and Control break sum values issue. |
|
|
Hi,
I would like to print a report by using CONTROL and SEQUENCE statements. I am getting Carriage control and summing values for minor CONTROL variable which i don't want. Below given the sample code of mine.
Code: |
REPORT PRINTER(RPT1) LINESIZE 132 NOADJUST NODATE NOHEADING TITLESKIP 0 NOPAGE SUMCTL NONE
SEQUENCE VAR1 VAR2 FLD2 FLD1 FLD3 VAR3
CONTROL FINAL NOPRINT FLD1 NOPRINT FLD2 NOPRINT FLD3
(After coding the TITLE values)
LINE 01 COL 01 VAR1 - (COL values are give here for coding purpose)
COL 10 FLD4 -
COL 20 FLD5 -
COL 30 VAR2 -
COL 40 FLD1 -
COL 50 FLD6 -
COL 60 VAR3 -
COL 70 VAR4
*
BEFORE-BREAK. PROC
IF LEVEL = 2 (As i need newpage on FLD2)
DISPLAY SKIP 2
DISPLAY 'TOTAL VALUES :' VAR5
DISPLAY SKIP 2
DISPLAY 'TOTAL CUMULATIVE VALUES :' VAR6
DISPLAY NEWPAGE
END-IF
END-PROC
|
My output report is showing like below
Code: |
1
************************ TITLE 1 ************************
************************ TITLE2 ************************
VAR1 FLD4 FLD5 VAR2 FLD1 FLD6 VAR3 VAR4
---- ---- ---- ---- ---- ---- ---- ----
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
(sumX) (sumX) sumX) (sumX) (sumX) (sumX) (sumX) (sumX) --Display after performing the CONTROL on FLD3
0 YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY
YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY
YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY
(sumY) (sumY) (sumY) (sumY) (sumY) (sumY) (sumY) (sumY)--Display after performing the CONTROL on FLD3
0 TOTAL VALUES : (value from VAR5)
(sumVAR5) --This is display after performing the CONTROL on FLD3 field
0 TOTAL CUMULATIVE VALUES : (value from VAR6)
(sumVAR6)--This is display after performing the CONTROL on FLD3 field
|
I want the report like below.
Code: |
1
************************ TITLE 1 ************************
************************ TITLE2 ************************
VAR1 FLD4 FLD5 VAR2 FLD1 FLD6 VAR3 VAR4
---- ---- ---- ---- ---- ---- ---- ----
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY
YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY
YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY
TOTAL VALUES : (value from VAR5)
TOTAL CUMULATIVE VALUES : (value from VAR6)
|
Please let me know how can we remove CC number for Detail ('0's)and summing values on last control field occurrence.
-Nath |
|
Back to top |
|
|
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Tue Sep 08, 2015 6:02 am Post subject: |
|
|
If there is any level of CONTROL you don't want the default totalling for, specify NOPRINT for that level. |
|
Back to top |
|
|
rg_nath Beginner
Joined: 03 Jul 2015 Posts: 23 Topics: 7
|
Posted: Tue Sep 08, 2015 6:44 am Post subject: |
|
|
Hi William,
Thanks for giving me an Idea. I have put NOPRINT for last CONTROL field and included the below proc. Now i have got the expected space without summing values.
Code: |
AFTER-BREAK. PROC
IF LEVEL = 1
DISPLAY SKIP 2
END-IF
END-PROC
|
But i have got CC character '-' for skipping line like below . is any way to avoid this CC?
Code: |
1
************************ TITLE 1 ************************
************************ TITLE2 ************************
VAR1 FLD4 FLD5 VAR2 FLD1 FLD6 VAR3 VAR4
---- ---- ---- ---- ---- ---- ---- ----
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
-
YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY
YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY
YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY
-
- (Here extra skip line displayed according to AFTER PROC logic)
TOTAL VALUES : (value from VAR5)
-
TOTAL CUMULATIVE VALUES : (value from VAR6)
|
-Nath |
|
Back to top |
|
|
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Tue Sep 08, 2015 7:15 am Post subject: |
|
|
Why do you want to get rid of the control character? |
|
Back to top |
|
|
rg_nath Beginner
Joined: 03 Jul 2015 Posts: 23 Topics: 7
|
Posted: Tue Sep 08, 2015 7:22 am Post subject: |
|
|
Hi,
As per client requirement, the report should not have any CC other than '1' . The template of report is created by using FOCUS and client wants the exact format to get in Easytrieve Report.
-Nath. |
|
Back to top |
|
|
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Tue Sep 08, 2015 8:17 am Post subject: |
|
|
What about two SKIP 1's instead of one SKIP 2? Comment it, so the next person along doesn't get confused as to why. |
|
Back to top |
|
|
rg_nath Beginner
Joined: 03 Jul 2015 Posts: 23 Topics: 7
|
Posted: Tue Sep 08, 2015 8:29 am Post subject: |
|
|
Hi William,
After commenting first 'DISPLAY SKIP 2' in above my code, the extra skip line was gone. Thanks.
But i need to get rid of CC. i am trying on this but no result and checking in manuals. Any idea?
-Nath |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12358 Topics: 75 Location: San Jose
|
Posted: Tue Sep 08, 2015 10:55 am Post subject: |
|
|
rg_nath wrote: | Hi William,
After commenting first 'DISPLAY SKIP 2' in above my code, the extra skip line was gone. Thanks.
But i need to get rid of CC. i am trying on this but no result and checking in manuals. Any idea?
-Nath |
Really? Do a search for Carriage and read upon it where it talks about the possible values for it.
_________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Tue Sep 08, 2015 11:36 am Post subject: |
|
|
You can't "turn off" the control characters directly.
You have three choices: only using "newpage" and "skip 1"; send the PRINTER file to disk and post-process it to change the control characters (logically); use a "report EXIT" to do that.
If there are limitations to how you can produce your output, it is less easy to use Easytrieve Plus than it is otherwise. You can combine a fixed-format output and the flexibility of Easytrieve by writing a REPORT EXIT. This can be done in COBOL and is very simple to "expand" the control characters.
So, permanent solution should be a PRINTER EXIT: until that is done (shouldn't take long, but...) you can ensure single-spacing (so two SKIP 1s rather than SKIP 2) or post-process a dsn. |
|
Back to top |
|
|
|
|