Page 1 of 1

pass field values to parameter

Posted: Thu Feb 14, 2008 3:06 pm
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.

Re: pass field values to parameter

Posted: Thu Feb 14, 2008 3:10 pm
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.

Posted: Thu Feb 14, 2008 3:11 pm
by dspxlearn
:? :? :? :? :?
Can you please put your requirement graphically?

Posted: Thu Feb 14, 2008 3:11 pm
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.

Re: pass field values to parameter

Posted: Sat Feb 16, 2008 11:34 am
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.

Posted: Sat Feb 16, 2008 12:36 pm
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.

Posted: Sat Feb 16, 2008 12:38 pm
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.

Posted: Sat Feb 16, 2008 2:06 pm
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

Posted: Fri Mar 14, 2008 10:04 am
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

Posted: Fri Mar 14, 2008 7:51 pm
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.