Page 1 of 1

Passing Column Name from Routine and get its value

Posted: Mon Jun 04, 2007 3:46 am
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

Posted: Mon Jun 04, 2007 9:39 pm
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

Posted: Tue Jun 05, 2007 5:19 am
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

Posted: Wed Jun 06, 2007 12:35 am
by ray.wurlod
Probably, but nothing is guaranteed.