pass field values to parameter

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
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

pass field values to parameter

Post by just4u_sharath »

i have a job where Oralce statge, its output is fed to output of Transformer and its output is fed to Sequential file. lets say transformer has a field and its derviation field is pulled direclty from its input i .e the derivation field will a column value (direct pull from oracle stage). Now i have to use this column value as my sequenctial filename. If i can pass this derivation field value as a value to parameter, and then use that parameter as sequential file. Is this possible. Can i pass values from job to job parameters.
Replies will be appreciated.
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: pass field values to parameter

Post by sud »

No, not in the same job. However, what you can do is run a separate job where you get the filename and then set the user status using Basic routine(setuserstatus) from within the job and pass out the filename to a sequence which can then call your actual job and pass the filename as a parameter.

Alternative to setting user status is to write the filename to a file and read it in the sequence again using Basic routine.
Last edited by sud on Thu Feb 14, 2008 3:12 pm, edited 1 time in total.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
dspxlearn
Premium Member
Premium Member
Posts: 291
Joined: Sat Sep 10, 2005 1:26 am

Post by dspxlearn »

:? :? :? :? :?
Can you please put your requirement graphically?
Thanks and Regards!!
dspxlearn
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No. You'll need to have the value before the job starts and pass it in as a Job Parameter to use it in the filename.
-craig

"You can never have too many knives" -- Logan Nine Fingers
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

Re: pass field values to parameter

Post by just4u_sharath »

sud wrote:No, not in the same job. However, what you can do is run a separate job where you get the filename and then set the user status using Basic routine(setuserstatus) from within the job and pass out the filename to a sequence which can then call your actual job and pass the filename as a parameter.

Alternative to setting user status is to write the filename to a file and read it in the sequence again using Basic routine.
where can i find this basic routine. I have checked all the routines available and didnt find the setuserstatus routine. Please explain me in detail if you dont mind.. And i didnt understand how can i pass a transformer field value to a sequencer.
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

Post by just4u_sharath »

chulett wrote:No. You'll need to have the value before the job starts and pass it in as a Job Parameter to use it in the filename.
How can i pass a transformer field value to the subroutine SetUserStatus. We cannot view the transformer field value (this is dynamic, changes for every job) in the after job subroutine. please help. I am totally confused.

Ultimate question is Can we pass the Transformer field value (only one record but changes for every job) of a job name xxx to the parameter list of the next job name yyy. This yyy has a flat file stage. Its name should include the transformer field value of previuos stage. If i can get that field value as a parameter, job is done. Is this possible with datastage. Please help. Totally confused on this issue.
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

Post by just4u_sharath »

chulett wrote:No. You'll need to have the value before the job starts and pass it in as a Job Parameter to use it in the filename.
How can i pass a transformer field value to the subroutine SetUserStatus. We cannot view the transformer field value (this is dynamic, changes for every job) in the after job subroutine. please help. I am totally confused.

Ultimate question is Can we pass the Transformer field value (only one record but changes for every job) of a job name xxx to the parameter list of the next job name yyy. This yyy has a flat file stage. Its name should include the transformer field value of previuos stage. If i can get that field value as a parameter, job is done. Is this possible with datastage. Please help. Totally confused on this issue.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'll need to create your own "interlude" to the DSSetUserStatus function. It's been discussed a number of times, for example here:

viewtopic.php?t=105450
-craig

"You can never have too many knives" -- Logan Nine Fingers
pchapma5
Participant
Posts: 6
Joined: Mon Oct 08, 2007 6:56 am

Post by pchapma5 »

Are you using sequences ? If so, you could always create a sequential file in one job containing just the file name. Then in the sequence, you use the 'execute command' to perform a unix cat on that file to retrieve the contents. The next job in the sequence can pick up the output from the cat command as a parameter using the 'Field' command on the output of the execute command. Use this as your filename.
Therefore, you have a sequence

JOB1 -----> XCMD ----> JOB2
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Just rename the file. Load your data into a Temp file and at the same time write the filename into another temp file. When the job finishes, pick the filename from the Temp file you stored it and rename your main file.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
Post Reply