Transformer without Primary Input

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
patonp
Premium Member
Premium Member
Posts: 110
Joined: Thu Mar 11, 2004 7:59 am
Location: Toronto, ON

Transformer without Primary Input

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
patonp
Premium Member
Premium Member
Posts: 110
Joined: Thu Mar 11, 2004 7:59 am
Location: Toronto, ON

Post by patonp »

Glad to hear it! Thanks for the quick response.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sun rays
Charter Member
Charter Member
Posts: 57
Joined: Wed Jun 08, 2005 3:35 pm
Location: Denver, CO

Re: Transformer without Primary Input

Post by sun rays »

I have used this method to create, empty hash files as a part of Initial set-up.
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

does this work for parallel jobs as well? I guess not, can someone confirm?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It does not but at least there you have the Row Generator stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post 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.
Thanks,
Chad
__________________________________________________________________
"There are three kinds of people in this world; Ones who know how to count and the others who don't know how to count !"
Post Reply