generate 4 digit sequence number

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
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

generate 4 digit sequence number

Post by just4u_sharath »

i have to generate a 4 digit sequence number after the whole job is created. And the when i run the job second time the generates sequence number should be equal to old number +1. i,e for each run sequence number should be increased. for this i cannot use oracle sequencer because of permissions. is there any stage i can use. can i get this number using unix script.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why not use one of the 'Key Management' routines in the sdk? By the way, what happens when your last number used is 9999?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I would recommend having your DBA create a sequence for you. This is what they are designed for and doing it another way is going to be more work to write and much more work to maintain - particularly when things go wrong.
You could use the server key management routines as Craig suggested, or you could create your own control file and update that. Try searching the forum as this topic has come up many times already.
Again - use your database's builtin facilities. Question why there are "permission" issues.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How do you propose to guarantee the "+1" requirement across an arbitrary number of parallel processing nodes? Are you going to introduce a bottleneck by forcing a Column Generator stage to execute in sequential mode? Is this, indeed, a sensible requirement in a parallel job?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

You can use the Surrogate key generator stage available in the parallel jobs..
It generates unique numbers on any number of processing nodes....

Hope this helps.. :)
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

They don't want to generate the sequence during the job but rather after it completes, from the way I read the OP. Hence my KeyMgnt suggestion, probably leveraged in a Sequence job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply