Modify Stage Dynamic Specifications

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
gagan8877
Premium Member
Premium Member
Posts: 77
Joined: Mon Jun 19, 2006 1:30 pm

Modify Stage Dynamic Specifications

Post 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
Gary
"A journey of a thousand miles, begins with one step"
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You need a KEEP specification OR an explicit specification.

Using both just bewilders the Modify stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gagan8877
Premium Member
Premium Member
Posts: 77
Joined: Mon Jun 19, 2006 1:30 pm

Post 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.
Gary
"A journey of a thousand miles, begins with one step"
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post 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,
- james wiles


All generalizations are false, including this one - Mark Twain.
Post Reply