Page 1 of 1

dynamically select the column at runtime

Posted: Sat Jan 16, 2016 12:15 am
by deesh
Hi,

I want to select the required column dynamically at run time.

Ex: out of 5 columns, may i will select any column at runtime, output should be only selected column data..

Posted: Sat Jan 16, 2016 8:39 am
by chulett
Schema files and RCP.

Posted: Sat Jan 16, 2016 2:30 pm
by chulett
:!: Not sure why this question was posted four times, including once well after I'd answered in this one. I nuked the other three.

Posted: Tue Jan 19, 2016 6:33 am
by Thomas.B
You can also use a Modify with the "KEEP" keyword.

Posted: Tue Jan 19, 2016 8:48 am
by chulett
Honest question - dynamically?

Posted: Tue Jan 19, 2016 3:47 pm
by ray.wurlod
The Modify stage KEEP specification can (and should in your case) be a job parameter.

Posted: Tue Jan 19, 2016 4:23 pm
by asorrell
Not certain what kind of environment you are doing this in, but I hope it isn't financial... this is the kind of thing that drives auditor's crazy!

Posted: Tue Jan 19, 2016 7:54 pm
by ray.wurlod
:lol:

Posted: Thu Jan 21, 2016 7:10 pm
by kduke
You could do it with a CASE statement and a job parameter.

Posted: Fri Jan 22, 2016 7:33 am
by vamsi_4a6
I have used modify with parameter as below

Keep #parameter1#

where parameter1 is the column name but not sure what i need to mention in the output column tab of modify stage since it is dynamic and also i can not use job parameters in column tab

Posted: Fri Jan 22, 2016 9:19 am
by ArndW
Unfortunately the side effect of "KEEP" is that all other columns are dropped. You want to do something like

Code: Select all

MyNewColumn[:type]=#parameter1#
and then you can work with "MyNewColumn" in the job; at the end don't neglect to

Code: Select all

#parameter1#=MyNewColumnName


so that the column is placed back into the stream.