Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Generate a Report thru COBOL Program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
kmanjunath
Currently Banned

New User


Joined: 27 Mar 2006
Posts: 3

PostPosted: Mon Sep 24, 2007 9:32 am    Post subject: Generate a Report thru COBOL Program
Reply with quote

Hi All,

I have an input file which has 100 rows with lenght 500.

Position 350 starts with Place ( Bangalore, Chennai, Pune, Mumbai)

I need to generate 2files out of my input file

The First file Should be just the copy of my input file and the second file should be a report.

The report should be having the following details

Header1
Header2
Date : Current Date
No of orders : 100
Details : Bangalore
Chennai
Pune
Mumbai




(IF Field(350:2) = 'BA' then move BANGALORE to report
IF Field(350:2) = 'CH' then move CHENNAI to report
same way with mumbai and pune.

I need to write the place name only once. Even if I have 10000 rows and if i have only 10 places in the files. I need to write only 10 rows (Place name) in the report.

Could you please suggest me how to do this.

I have done the coding. I am facing some problems.
Back to top
View user's profile Send private message

Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Mon Sep 24, 2007 10:56 am    Post subject:
Reply with quote

keep a working storage table with fields Place and Counter. While reading the file increment the counters for each place and also create file 1 (same as input file).

At the end write report 2 to print the unique place with counter from the table.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Sep 24, 2007 4:37 pm    Post subject:
Reply with quote

how about sorting the file?
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Sep 24, 2007 9:08 pm    Post subject:
Reply with quote

Hello,

Quote:
I have done the coding. I am facing some problems.
If you post the "problems" we may be able to help. We cannot guess at what is not working.

It will also help if you post some sample input data.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us