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!

File Locking 1

Status
Not open for further replies.

Houcmak

Programmer
May 8, 2004
3
BE
Hi,

I must create a program for school in which I need to support multi-users. So we have to use file locking, but I don't fully understand it (and can't find tutorial on this subject on the net, COBOL is too old damn it ! :/).

So i'm using manual locking on the file, could you tell me more about locking like: when do i need to lock the record, when to unlock it, etc. ?

I'm really desesparate :(

Huge thanks.

Houcmak
 
Can you indicate, please, what compiler you might be using? File and record locking is ab extension which almost every COBOL compiler vendor has, but they do it a bit differently.

Tom Morrison
 
The compiler is Visual Object COBOL (Visoc).

Thanks for helping guys (but i'm still blocked unfortunnaly :(( )
 
Hmmm I think I've understood now, my program is progressing quickly. But I have another question for you:

If I load my program 2 times to test in multi-users context, the second instance say that one of the file is locked (by the other instance if course).

So i'm wondering, anyway to set a file's mode to shareable ?

Thanks
 
Compiler and operating system please. Also, could you show us the relevent code.
 
Some compilers will do the locking automatically, and will not lock the file unless you open it with lock.

Others will lock the file unless you specify " LOCK AUTOMATIC" on the SELECT.

Not sure what your's do, but look at the manuals, and if nothing else try the above.


Regards

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

Part and Inventory Search

Sponsor

Back
Top