Passing Column Name from Routine and get its value

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
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Passing Column Name from Routine and get its value

Post by DS_SUPPORT »

I want to calculate CRC value for dynamic columns, we are in a type of product development, so it is upto customer to choose the columns, he wants to track the changes. So i thought of maintaing something like parameter file, and define the columns there. And while running the job, i want to read the parameter file and get the column names.

I wrote a routine which will get the jobname and linkname as input and give the output like

Code: Select all

Type2.PRODUCT_ID : '|' : Type2.DESCR
This is like the same way, we will do the concatenation in the job before calculating the CRC, So i thought it would work. But it is treating the value as a string and not taking the corresponding value from the columns.

Suppose if my input is like

Code: Select all

PRODUCT_ID       DESCR
TEST_PROD         TEST_PRODUCT
TST1               TEST_PRODUCT1
I want my job to work like

Code: Select all

TEST_PROD|TEST_PRODUCT
TST1|TEST_PRODUCT1
Now, my job is calculating the CRC value for the string "Type2.PRODUCT_ID : '|' : Type2.DESCR", Is there any way to substitute them with the corresponding incoming values.

If i use job parameters also, it is considering it as a string only and not substituting the values.

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

Post by ray.wurlod »

Not easy to do in a server job. Indeed, you would need to "hack" the underlying structures, which is never to be recommended.

If you want to persist, search the forum for STAGECOM.ARR
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

Ray, Thanks for guiding me to the right path. I have wrote a routine based on some previous posts.

Now the job is working fine as per my requirement. The question which comes to my mind is , As this is undocumented method, whether it will work in Datastage 8.

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

Post by ray.wurlod »

Probably, but nothing is guaranteed.
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