Setting column value as 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
verify
Premium Member
Premium Member
Posts: 99
Joined: Sun Mar 30, 2008 8:35 am

Setting column value as Parameter

Post by verify »

I have a sequential file as source it has one field as "Table_Name".My requirement is to extract the table name values from the Table_Name field and create a target file with name as that of "Table_Name".

Note: The sequential file will contain only one record.

For e.g:-
Case1:-
Source:-
Table_Name Col1 Col2
Emp Tom 23

I have to create target file with "Emp" as it's name.

Similarly for Case2:-
Source:-
Table_Name Col1 Col2
dept Finance 30

I have to create target file with "dept" as it's name.

Do i need to set the column value as parameter.
In transformer i tried using DSSetParam command to set as parameter but it didn't work..

Please help me out...
RK Raju
Pagadrai
Participant
Posts: 111
Joined: Fri Dec 31, 2004 1:16 am
Location: Chennai

Re: Setting column value as Parameter

Post by Pagadrai »

Hi,
You cannot change the value or assign the job parameter when the job is executing. That is why DSSetParam wont work in the transformer.

You have to fetch the value from the file and then pass it to the DS job as paramter.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You could create two jobs - one to fetch the values and pass them as parameters to the second job to do the creation. Use UtilityRunJob() in the first job to run the second job once per record read.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The first job will need to be a server job or use the BASIC Transformer stage if a parallel job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
shamail
Participant
Posts: 10
Joined: Mon Jan 12, 2009 10:36 pm

Post by shamail »

Or probably u can try writing the first field that is name of the file into a file in the same job and use the content of this file in a after job subroutine to the rename the original file (one containing the data) created in the same job.
Post Reply