dynamically select the column at runtime

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
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

dynamically select the column at runtime

Post 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..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Schema files and RCP.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
Thomas.B
Participant
Posts: 63
Joined: Thu Apr 09, 2015 6:40 am
Location: France - Nantes

Post by Thomas.B »

You can also use a Modify with the "KEEP" keyword.
BI Consultant
DSXConsult
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Honest question - dynamically?
-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 Modify stage KEEP specification can (and should in your case) be a job parameter.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post 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!
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:lol:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

You could do it with a CASE statement and a job parameter.
Mamu Kim
vamsi_4a6
Participant
Posts: 95
Joined: Wed Jun 04, 2014 12:06 am

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

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