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
 

 

Creating Header Record with Summary Information

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

New User


Joined: 02 May 2006
Posts: 7
Location: Charlotte, NC, US

PostPosted: Tue Oct 17, 2006 7:41 pm    Post subject: Creating Header Record with Summary Information
Reply with quote

Hi,

I am currently working on a Reformatting code, I receive a input transaction file having some account & amount fields, Using this i create a o/p file which will add up the amounts for a particular account and then populate a header with the amount total followed by the list of detail transactions, I can have multiple headers in my file each having a set of detail records.

When populating the header i need to know to total amount & all the total no of detail record having the same account in advance. because I need my header written first then only i write the detail records in my o/p file. Also I cant store the individual transactions in an array as the file is very huge its having around 1 Million records.
I can create a header without the summary information(Amount total) and then read the file again just to update the header.

Is there a better solution.

Thanks in advance, I would greatly appreciate your help.

Regards
Rajanish
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Oct 17, 2006 10:55 pm    Post subject: Re: Creating Header Record with Summary Information
Reply with quote

Rajanish,

What is the max number of detail rrecords you are going to have per header record? This would be the number you would have to store is a COBOL table, not the entire transaction file.

The transaction file should be sorted by account number prior to processing.

Also you might look at using DFSORT for this. Frank Yaeger of the DFSORT/ICETOOL forum can probably give you a DFSORT solution.

Dave
Back to top
View user's profile Send private message
rajanish

New User


Joined: 02 May 2006
Posts: 7
Location: Charlotte, NC, US

PostPosted: Tue Oct 17, 2006 11:39 pm    Post subject:
Reply with quote

Thanks Dave,

My Program can have all the records summarized in a single header or can have 100 headers, It all depends on the file i receive.
Anyway I will try looking at DFSORT.
Back to top
View user's profile Send private message
reddy307
Currently Banned

New User


Joined: 09 Jun 2006
Posts: 18

PostPosted: Wed Oct 18, 2006 2:48 pm    Post subject: Re: Creating Header Record with Summary Information
Reply with quote

by using DFSORT u can achieve it

try the following code to summarise the fields

sort fields=(starting pos, length,format,a/d) this is of ACCOUNT NO
Sum fields=(the fields that u need to summarise)


then u will get the summarised fields for each acct no

then u can use that in ur COBOL pgm

Regards
Reddy
Back to top
View user's profile Send private message
rajanish

New User


Joined: 02 May 2006
Posts: 7
Location: Charlotte, NC, US

PostPosted: Thu Oct 19, 2006 6:45 am    Post subject: Creating Header Record with Summary Information
Reply with quote

Thank you.
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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