Page 1 of 1

Modify Stage Dynamic Specifications

Posted: Tue Feb 07, 2012 2:38 pm
by gagan8877
The article "how-to-become-a-modify-stage-zen-master":

http://it.toolbox.com/blogs/infosphere/ ... ster-20368

says "The Modify Stage is overloaded with specifications - it has 20 specification job parameters that are all set to blank and it will only run the ones that you populate at run time."

I tried to achieve this functionality using a string job parameter in the specification and not setting a value for it (blank) - It didn't work.

My job has column generator, modify n oracle target.

4 Specifications using job parameters in the modify stage,

3 input columns all varchar(10): Col_1, Col_Rename, Col_3 and Col_4

I kept 3 columns, renamed one in the modify

and wrote them to target that has 3 output columns: COL_1, COL_2 and COL_3.

RCP is on and no columns defined on the columns tab of modify or Oracle enterprise stages.

I got:

Error Parsing Modify Adapter. Error in binding. Expected destination destination field selector, got: ";"; input:
KEEP Col_1, Col_Rename, Col_3
;
Col_1=COL_1
;
Col_2=Col_Rename
;
Col_3=COL_3
;
;
[sil/step_il.C:3442]

Without the last blank specification the job runs fine. But if we have a requirement for adding an extra columns at run time, we need to have blank specification in there - am I even interpreting the article correctly?

I tried setting Col_4 to itself i.e. Col_4=COL_4, but kept only 3 columns and that worked. But still my step does not match with the article.

Can someone please shed some light on this?

Thanks
Gary

Posted: Tue Feb 07, 2012 6:32 pm
by ray.wurlod
You need a KEEP specification OR an explicit specification.

Using both just bewilders the Modify stage.

Posted: Wed Feb 08, 2012 10:03 am
by gagan8877
Thanks Ray, I will make that correction in my job. But the question is can I have blank specifications in there that can be used later dynamically at runtime - as the article suggests.

IBM documentation says there is no default for the Specification:

http://publib.boulder.ibm.com/infocente ... stage.html

So either I am misinterpreting the article or it is incorrect.

Posted: Wed Feb 08, 2012 11:14 pm
by jwiles
Instead of using individual specifications with one parameter each:

Code: Select all

Specification=#MOD_SPEC_1#
Specification=#MOD_SPEC_2#
try placing all parameters on a single specification:

Code: Select all

Specification=#MOD_SPEC_1##MOD_SPEC_2#
and include a ';' at the end of all populated specifications except for the last

Code: Select all

MOD_SPEC_1: b:string=a;
MOD_SPEC_2: a=a
Regards,