Target file layout - Dynamic change

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
vij
Participant
Posts: 131
Joined: Fri Nov 17, 2006 12:43 am

Target file layout - Dynamic change

Post by vij »

Hi all,

I am creating a job, in which i am using a sequential file as target file.

My requirement is that the structure of the file, i mean the no. of the columns columns should change dynamically, based on a single value from the input..

for eg., if this is the i/p :

100,A1,234567
120,B1,123456789,abcdefg

the corresponding o/p should be:

100,A1,234567
120,B1,123456789,abcdefg

based on the value of 2nd column the number of columns shuld vary and only one output file should be used...

any help is appreiated.

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

Post by chulett »

You are going to have to manage this. Assemble the record in a single large field, delimeters and all - then write it out to a Sequential File stage with one Varchar field and the Quote Character set to '000'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vij
Participant
Posts: 131
Joined: Fri Nov 17, 2006 12:43 am

srop /keep columns conditionally

Post by vij »

is there any stage which drops / keeps columns based on a condition?

eg.,
column1 =1, drop input column ...
or isnull(i/p column), drop it

like this?

We can use the modify stage for keep/drop columns, but i want to know is that possible to do the same based on some condtion ...
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Read the file and pass it as a parameter to the next job based on the condition. I havent tested if Modify accepts paramter.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply