Beta Testers Needed |
|
Marble Computer, a COBOL data correlation and documentation company, is looking for companies to beta test their
COBOL
Field Expansion product.
If you are interested in becoming a beta tester for Marble Computer,
contact COBUG at Beta Tester for more information.
|
 |
Support COBUG |
|
 |
|
 |
|
|
| |
|
COBOL Language [
return
] |
|
From |
Message |
Henry141
10/04/2006 23:25:52
|
Subject: Please Help
Message: I have a problem .
My input file has the following format
000 - Header Level
100 - Detail Level (Can be upto 9000 records)
999 - Traler Level
(000 - 999=One Batch of records
This continues for around seven bathces, where this record layout is maintained
In the detail level only, there is a field called as PA-TRANSACTION-CODE, which is three bytes long
If this field has all values as 999 or 998, then downstream all my files and all my programs are having a problem.
So what I decided is let us check each transaction code in all the detail records for one batch (i.e from one header to trailer)
and if it contains all 999 or 998, then I will force enter the value 264 in the last record and that will solve my problem
Is there any way to solve this using cobol or any other utility.
The problem is that 999 trailer record will be read for every batch record and it does not allow me to modify the last record of the
detail level.
Please help
|
JSA
10/04/2006 23:49:42
| RE: Please Help
Message: You must implement basic read-ahead logic. That
is, you want to have two buffers. One for the
current record, and one for the next record.
That way you will always have the last detail in
memory, when you read the trailer.
Read to buffer 1 first time to prime the pump
Loop:
Move buffer 1 to work buffer
read to buffer 1
work on work buffer (with the capability to
(look ahead to next record in buffer 1)
write our work-buffer
go to loop.....
|
Henry141
10/10/2006 05:49:24
| RE: Please Help
Message: hey man,
i tried implementing this logic, but i am facing this problem:-
see my issue is that i want to modify the last record if all the transaction codes in a particular batch are 998 or 998
the logic i am using is as follows:-
read the file into the storage-1
move storage-1 to storage-2
Then write storage-2 into the output file.
Before i can modify the last record just before the 999 trailer record, it is already written.
and then an extra line gets added instead of modifying this line.
Please help
|
cobolfan77
1/22/2007 17:09:36
| RE: Please Help
Message: Use a interactive screen display to pull up teh record you want ot modify, and manualy input the changes and do a real time update usign a rewrite command. NOTE: you need to make sure the file being accessed is random, and be sure to ahve a primary key set. Open te file as I-O so you can "rewrite" teh data. This will work. I have done it myself and its freakin' sweet!!!!
COBOL ROCKS!!!!!!!!!
Williami
|
|
|
|
|
|
|
|
|
|
|
[ Go to Top of Page ]
|
|
 |
|
Local COBOL User Groups |
Check out the list of local COBOL user groups from around the world and join a user group near you.
|
 |
|
Call for User Group Leaders! |
Get Involved! We are looking for user group
leaders to help organize and coordinate a local COBOL user group.
|
 |
|
Join COBUG! |
Become a part of the COBUG community today.
Join Now ...
|
 |
|
COBOL Forums |
Try our forums for help!
Let the COBUG members help you.
Post your issues!
|
 |
|
Job and Resume Matchmaker! |
Employers submit your COBOL job openings.
Job seekers submit your resumes.
|
 |
|