Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cobol question

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Question: evaluate record from big VSAM file. if something wrong
write this record to another file. next day start process
big file from this record. How we should open big file? Can somebody describe process?
Thanks, edsmol.
 
Hi Edsmol,

It depends on how you plan to process the big file. I assume you plan to process it sequentially from the rec you wrote the day before. But you didn't say if you are updating these big file recs or just reading them. You also didn't say what you do the next day if you process OK on the current day.

If you are updating you OPEN I-O; if you are only reading the file you OPEN INPUT. If you're planning to do RANDOM reads against the BIG-FILE use ACCESS IS DYNAMIC in the SELECT clause. If not SEQUENTIAL will do.

In either case you do the following:

Code:
One thing you can do if prev day went OK is move ZEROS to 
SAVED-KEY; if not read SAVED-FILE and 
START BIG-FILE KEY IS >= SAVED-KEY
READ NEXT BIG-FILE
Check my syntax; I don't have a manual handy.

Regards, Jack.
 
OK! More detail. Read VSAM sequentially max 500,000 a day. Evaluate record. If OK, check condition. If met, write record to ARCHIVE FILE. Next read. Something wrong with record.
Write this record to another file, Abend program. Next day
users fix record. Start process from this record and conti
nue write ARCHIVE FILE. Nothing wrond, start next day from
500,001 record.
If you need more info please let me know.
Thanks.
Edsmol.

 
Hi Edsmol,

The error processing is OK as I,ve shown. On successful completion, however, you have to save rec# 500001. The best solution for restart is to write THAT rec to the error file too. That way the logic stays the same for next day's processing.

Your problem here may be that you (or the user) have to destinguish this rec from an error rec. If that can't be done you have to store it somewhere else and write the code to support that.

Regards, Jack.
 
Hi Edsmol,

Thinking about it, you can create an error rec file and a restart file. Always writ ethe appropriate rec to the restart file and always use it to find your starting point. Only use the big-rec key as your restart-rec.

One other point: you didn't mention about starting at rec# 1 again. I guess you can write a zeros restart-rec when you reach EOF on the big-file.

I also forgot to mention that you should always check for > after the START; the only time that a > rec should be returned is when you moves zeros to the big-file key.

Regards, Jack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top