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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flat File contineuos read

Status
Not open for further replies.

anneq

Programmer
Apr 6, 2006
2
IE
Hi,

I am hoping that some experts in the field would be able to point me in a direction. I have modified many cobol programmes by adjusting the logic or adding reads or writes to similar type files. I would not consider myself a cobol expert but I should be able to follow a cobol converstaion.

I have a site where a screen creates an ascii Flat File (sequiental) I have no control over the screen and cannot modify it. I need to read this flat file and produce an output file. The issue is I only want to read from the last record I have read. So as the records are read by the cobol the screen could be adding records so I need to remain at the last record until the next record is entered in the flat file. There is no key on the file.

Is it possible to read from the last record read and if there is another record process it if not trigger a read again.

I was wondering if this logic was possible within Cobol or if anybody had done something similar. The environment is a HP3000 operating mpe/ix.

thanks in advance.

Anne
 
You dont mention how big this file is or how timely you need to be in reading the next record. For one thing you could simply read the file over and over, keeping track of the last record number read and then making sure you are reading past that record number for subsequent loops beyond the first pass. You could also possibly structure a script that copies the file, compares the file size to the last file size, then calls the program if it is bigger, otherwise it sleeps for a few minutes then repeats the process.
 
You can do this easily with a message file on MPE/iX. Message file reads simply wait for another record to be written before returning control to the COBOL program.

You may want to pose your question on the HP3000-L newsgroup for further advice.

Regards,

Glenn
 
Hi

thanks to both of you for your reply. Glen, I cant change the output screen to make it write to a msg file but I will pose the question to the hp300 group to see if there is a way to make the system think it is a msg file. I can't see how but others out there might know.

thanks

Anne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top