View previous topic :: View next topic
|
Author |
Message |
Kranthi M
New User
Joined: 07 Oct 2011 Posts: 20 Location: India
|
|
|
|
Hi,
I am trying to Generate a report by converting REPORT SECTION coding to PROCEDURE DIVISION Coding.
I need some light on REPORT SECTION keywords like TYPE IS CONTROL FOOTING.
I have below statements in the REPORT SECTION in a program:
TYPE IS CONTROL FOOTING FINAL
TYPE IS CONTROL FOOTING WS-COMPANY NEXT GROUP NEXT PAGE
EMP-BREAK TYPE IS CONTROL FOOTING WS-EMP-NO.
TYPE IS CONTROL FOOTING WS-ZIP.
TYPE IS CONTROL FOOTING WS-NAME.
EMP-DATE-BREAK TYPE IS CONTROL FOOTING WS-EMP-DATE.
05 LINE NUMBER IS PLUS 1.
10 COLUMN 27 PIC 9(5) SOURCE IS WS-ZIP.
10 COLUMN 36 PIC ZZZ999999 SOURCE IS WS-EMP-NO.
10 COLUMN 53 PIC X(10) SOURCE IS WS-EMP-DATE.
10 COLUMN 67 PIC X(22) SOURCE IS WS-NAME.
10 COLUMN 90 PIC Z,ZZZ,ZZZ.99- SUM WS-TOT-SALARY.
All I want to know is how these statements can be converted into PROCEDURE DIVISION statements.
I tried looking into some materail. But could not really understand. May not looking at proper material.
Please help
THere are 5 columns and last column has a SUM key word on it. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
So you are going from the Cobol Report Writer to a Cobol program to produce the report without the Report Writer.
Do you not have a specification for the original report? An example of the report?
All the stuff you mention is to do with what to do when a "key" changes. The FOOTING stuff is just the bottom of the page for information at different levels of "control".
If you search for the Cobol Report Writer manual, you should find it all quite easy to follow. |
|
Back to top |
|
|
Kranthi M
New User
Joined: 07 Oct 2011 Posts: 20 Location: India
|
|
|
|
Hi, Thanks for the reply.
Yes, we are going to take out REPORT WRITER code and replace it with PROCEDURE Division code.
Can you please eloborate more on "WHEN KEY CHANGES"?
Do i need to include name in the key-break for the last CONTROL statement when i convert it to PROCEDURE DIVISION statement?
I get different output with PRODUCTION code - report writer and Test code - after conversion.
Trying to find the Root Cause.
REPORT EXAMPLE:
Trying to generate report that has EMP-NO, ZIP, NAME, DOJ-DATE, SALARY AND FINALLY AT THE FOOTING SUMMARY OF SALARY IF DOJ-DATE-CCYY-MM IS EQUAL TO 201012. tHERE ARE 5 LINES OF HEADING TO THIS. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Did you find the manual I suggested? Try here.
Say you have a report that is sequenced by Company, Branch and Date. You want end-of-day totals. Company, Branch and Date are your CONTROL fields, because, logically, you need totals if the Date is the same but the Branch is different, if if Date and Branch are the same but Company is different. You also might like FINAL totals, depends on the data.
In your Cobol program, you have to write code for all of that. In the Report Writer, you just make the definitions and the rest is done for you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
All I want to know is how these statements can be converted into PROCEDURE DIVISION statements. |
There is no one-to-one standard COBOL statement conversion available (as far as i know).
Several of the Report Writer statements will cause multiple working-storage data items to be created as well as the procedure division code to use these variables.
Suggest you consider running a test of the existing code with a Very Small amount of input data. Understand what is produced from the test data. Then write the specification to re-write theis in standard COBOL. Code and test the new code with increasing amounts of data once the initial testing is complete/correct. |
|
Back to top |
|
|
Kranthi M
New User
Joined: 07 Oct 2011 Posts: 20 Location: India
|
|
|
|
Thanks for the Reply. I was just trying to understand what a CONTROL FOOTING with BREAK means. From a REPORT WRITER material I found that its kind of KEY BREAK and we are supposed to nest conditions as many CONTROL statements as we have.
Trying to code it accordingly. Will get back, If I still have issues. |
|
Back to top |
|
|
|