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

Generate a Report thru COBOL Program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
Reply with quote

how about sorting the file?
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: Mon Sep 24, 2007 9:08 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top