Page 1 of 1

Transformer without Primary Input

Posted: Wed Feb 01, 2006 7:32 am
by patonp
I've created a job that uses DSJobStartDate to retrieve a related record from a database table and populate a hash file. The job flow is as follows:

Code: Select all

         DB  Referential Lookup
                      |
Transformer1 -->Transformer2-->HashFile
In order to accomplish this, I've created the job such that Transformer1 does not have a primary input. Instead of an input link, I've created a stage variable named RowLimit with a default value of 2. Within the constraint of the output link, I've specified a condition of @OUTROWNUM < RowLimit. The job successfully compiles and processes a single row, as desired.

I'm not sure whether this method (i.e. using a transformer without an input link) is documented anywhere and would like to know whether there is any drawback to this approach.

Thanks!

Peter

Posted: Wed Feb 01, 2006 7:35 am
by ArndW
That method has been an accepted approach since far back in the distant past versions of DataStage. I am not aware of it being officially documented in any of the manuals, though.

Posted: Wed Feb 01, 2006 7:48 am
by patonp
Glad to hear it! Thanks for the quick response.

Posted: Wed Feb 01, 2006 7:48 am
by chulett
As noted, a perfectly acceptable and very cool approach. I've used it to generate calendar data, gobs of test data and sometimes (with a constraint of @FALSE) to clear a hashed file lookup that is also written to in the same job before the main input stream starts. I believe that I first saw it in an old collection of "Tips and Tricks" years ago, but couldn't say for cetain.

But never "officially" documented that I am aware of either.

Re: Transformer without Primary Input

Posted: Wed Feb 01, 2006 12:09 pm
by sun rays
I have used this method to create, empty hash files as a part of Initial set-up.

Posted: Wed Apr 27, 2011 8:04 am
by mctny
does this work for parallel jobs as well? I guess not, can someone confirm?

Posted: Wed Apr 27, 2011 8:50 am
by chulett
It does not but at least there you have the Row Generator stage.

Posted: Wed Apr 27, 2011 10:43 am
by mctny
I just wanted to pass some job parameters to some columns of a transformer so that I can pass those column values to a shared container. I guess I will have to use a row generator and then a transformer and then the shared container. looks like it is not possible with only a transformer and shared container in a parallel job.