Bypassing a Locked Record, Take Two
January 7, 2009 Hey, Ted
|
I have a slightly different solution to the locked record problem your friends tackled in Bypassing a Locked Record. Like them, I have RPG programs that sequentially read a file and update some of the records. When a program tries to read a record that another job has locked, I sometimes bypass the locked record. Here’s how. Notice the READ operation in the second calculation of this example:
FSomeFile UF E K Disk Prefix(SR_)
D Forever S N inz(*On)
D Open C Const(' ')
D Closed C Const('Z')
/Free
DoW Forever;
Read(E) SomeRec;
If %Eof(SomeFile);
Leave;
EndIf;
If %Error();
|


