IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

conversion of REPORT generation from REPORT SEC to PROC Divi


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Kranthi M

New User


Joined: 07 Oct 2011
Posts: 20
Location: India

PostPosted: Thu Dec 29, 2011 4:49 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Dec 29, 2011 5:13 pm
Reply with quote

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
View user's profile Send private message
Kranthi M

New User


Joined: 07 Oct 2011
Posts: 20
Location: India

PostPosted: Thu Dec 29, 2011 5:30 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Dec 29, 2011 5:40 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Dec 30, 2011 10:12 am
Reply with quote

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
View user's profile Send private message
Kranthi M

New User


Joined: 07 Oct 2011
Posts: 20
Location: India

PostPosted: Fri Dec 30, 2011 5:21 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts DFHPI1008 JSON generation failed COBOL Programming 0
No new posts Need help on formatting a report DFSORT/ICETOOL 14
No new posts file manager is doing string conversion IBM Tools 3
Search our Forums:

Back to Top