Need help in understanding "KeyMgtGetNextValueConcurren

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Need help in understanding "KeyMgtGetNextValueConcurren

Post by zulfi123786 »

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???
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, you need to ensure that both files "open"ed point to the same physical file. You can replace the "OPEN" command on one project with an "OPENPATH" command and use the full path to the hashed file in the other project.
Post Reply