Generate new 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
krishna81
Premium Member
Premium Member
Posts: 78
Joined: Tue May 16, 2006 8:01 am
Location: USA

Generate new column at runtime

Post by krishna81 »

Hi,
I need to generate columns at runtime of job.
job flow like

Seqfile--->TX---->SeqFile

here is my input.

I/p

column1:
ROW1--> aaaa/bbbb/cccc/dddd
ROW2--> eeee/ffff/gggg/hhhh

O/P shoul be

COLUMN1 COLUMN2 COLUMN3 COLUMN4
aaaa bbbb cccc dddd
eeee ffff gggg hhhh

there is no consistancy in delimited fields.


I appreciate for your quick response

kris.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Generate new column at runtime

Post by chulett »

krishna81 wrote:there is no consistency in delimited fields.
What does this mean? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
krishna81
Premium Member
Premium Member
Posts: 78
Joined: Tue May 16, 2006 8:01 am
Location: USA

DS 8X

Post by krishna81 »

For example
in the inputfile we have 6 delimited fields in column1
and at second run
in the inputfile we have 5 delimited fields in column1
and at 3rd run
inputfile we have 7 delimited fields in column1.


the expected out put must be

the Outputfile should create whith 6 columns(where each delimited field goes to each column)
and at second run
the Outputfile should create whith 5 columns(where each delimited field goes to each column)
and at 3rd run
the Outputfile should create whith 7 columns(where each delimited field goes to each column)

executing one datastage Job to process these different files.
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Post by Vinodanand »

Hi,

Please check the below link,its not the exact requirement but can help you to think more on the same line,hope it helps !.
http://dsxchange.com/viewtopic.php?t=96 ... c63ff43e05
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There's no automated way to do what you want. AFAIK, you will need to treat the record as one long varchar field in job and append the columns and field delimiters based on what you find in the input.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply