How to get a max value of unique key from hash file.

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
vinovenkat
Participant
Posts: 8
Joined: Mon Dec 29, 2008 5:24 am

How to get a max value of unique key from hash file.

Post by vinovenkat »

Hi ,

i have situation where DS job multiple times and appends records into hash file which doesnt have the unique value.so i am trying to create the surrogate key in transformer stage and append the data based on the SGkey value. i tried few logics but nothing is working out ..how to go about it...



vinoth.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What have you tried?

The answer that most readily springs to mind is to use a UniVerse stage (which means that you must have a VOC pointer to your hashed file) and in it derive SGKey as MAX(SGKey).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vinovenkat
Participant
Posts: 8
Joined: Mon Dec 29, 2008 5:24 am

Post by vinovenkat »

I used @inronum and KEYGen routine.one more thing which i forget to add is the batch job which uses this hash file clears the hash file content at the end of the batch run.So in the next run the hash file will have no records in it.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So what precisely is your problem? Sounds like you need to initialize the SDKSequences hashed file within the job sequence (batch). Search DSXchange for details of how to do so.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply