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

Creating Header Record with Summary Information


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
Search our Forums:

Back to Top