spliting a string in one column into many rows

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

spliting a string in one column into many rows

Post by rafik2k »

Hi,
i have a requriement where i need to lists all the job in a project.
For this i have used DSGetProjectInfo(DSJ.JOBLIST) function in the transformer and capturing the output in one column in a comma delimated sequential file.

I am getting outpur like this
column1
=========
A,B,C,D,E,F etc

But i need output like following
column1
=====
A
B
C
D
E
F
etc

Please advise me how to acheive this.

thanks in advance

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

Post by chulett »

This is answered in the FAQ forum. Basically all you need to do is replace the commas with the EOR characters for your O/S - in your case <CR><LF> pairs. Write out one record like that and it will read back in as many.

Use functions like Convert or EReplace along with CHAR(13):CHAR(10).
-craig

"You can never have too many knives" -- Logan Nine Fingers
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

Hi Chulett,
Thanks for response.
One morething where to use Convert or EReplace function i mean in transformer or in basic routine

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

Post by chulett »

Up to you, it can be done in either place. In this case it isn't complex enough that it must be done in a routine, so suggest you stick within the transformer.
-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 »

This is the FAQ post I mentioned, in case you hadn't found it yet.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

chulett wrote:This is the FAQ post I mentioned, in case you hadn't found it yet.
Thanks Chulett,
I implemented ur logic and it's working fine.

Once again thanking you.

Regards,
Rafiq
Post Reply