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

reading file with out lock

Status
Not open for further replies.

shaily123

Programmer
Feb 5, 2005
17
0
0
US
Hi, I am new to cobol. I have to read an index file for specific key but with out locking the file. That specific key is not unique.


I looked in to books and got confuse. Do i have to first START the file then READ it with NEXT.

or I can directly read the file.

Please help.....
 
If your key is not unique, then you'll have to do a START, and then READ NEXT until EOF or the key value changes.

some pseudo code:
Code:
start my-file my-file-key2 >= ws-key-value

read my-file next record

perform until eof or my-file-key2 not = ws-key-value
  do logic on record
  read my-file next record
end-perform


.DaviD.
 
If you wish to read the record without locking the file you will need to open the file as input, or to issue a read no lock (if you only wish not to lock the record).

Depending on your compiler/os you may need to do further things.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top