Need help in understanding "KeyMgtGetNextValueConcurren
Posted: Sun Sep 20, 2009 5:03 am
The code for the above routine is
EQUATE RoutineName TO 'KeyMgtGetNextValueConcurrent'
If NOT(Initialized) Then
* Not initialised. Attempt to open the file.
Initialized = 1
Open "SDKSequences" TO SeqFile Else
* Open failed. Create the sequence file.
EXECUTE "CREATE.FILE SDKSequences 2 1 1"
Open "SDKSequences" TO SeqFile Else Ans = -1
End
End
* Read the named record from the file.
* This obtains the lock (waiting if necessary).
Readu NextVal From SeqFile, Arg1 Else
NextVal = 1
End
Ans = NextVal
NextVal = NextVal + 1
* Increment the sequence value, and write back to file.
* This releases the lock.
Write NextVal On SeqFile, Arg1 Else Ans = -1
I want to know what this does "
Open "SDKSequences" TO SeqFile"
The problem is this routine uses universe file to hold the next availabe value, I have two environments and i need the next values for both environments to be same. Can i do it by replacing one file with other???
EQUATE RoutineName TO 'KeyMgtGetNextValueConcurrent'
If NOT(Initialized) Then
* Not initialised. Attempt to open the file.
Initialized = 1
Open "SDKSequences" TO SeqFile Else
* Open failed. Create the sequence file.
EXECUTE "CREATE.FILE SDKSequences 2 1 1"
Open "SDKSequences" TO SeqFile Else Ans = -1
End
End
* Read the named record from the file.
* This obtains the lock (waiting if necessary).
Readu NextVal From SeqFile, Arg1 Else
NextVal = 1
End
Ans = NextVal
NextVal = NextVal + 1
* Increment the sequence value, and write back to file.
* This releases the lock.
Write NextVal On SeqFile, Arg1 Else Ans = -1
I want to know what this does "
Open "SDKSequences" TO SeqFile"
The problem is this routine uses universe file to hold the next availabe value, I have two environments and i need the next values for both environments to be same. Can i do it by replacing one file with other???