Page 1 of 1

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

Posted: Tue Dec 30, 2008 8:32 am
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.

Posted: Tue Dec 30, 2008 8:54 am
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).

Posted: Tue Dec 30, 2008 9:10 am
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.

Posted: Tue Dec 30, 2008 2:39 pm
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.