regarding spliting the records

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
sujatha dasa
Participant
Posts: 7
Joined: Mon May 12, 2008 5:57 am
Location: near BEML gate

regarding spliting the records

Post by sujatha dasa »

hi,

In my project there is one requirement that is
our souce is db2 table.For one column the data is comming like below

ws
ts/fe
rs
rs/js/lk/md

the requirement is i need to split the all the records which is having '/'.like below.

ws
ts
fe
rs
rs
js
lk
md

Can any one help on this.

Thanks
sujatha
SUJA
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Convert '/' to newline.

Search for "urgent" and see response from Ray.
sujatha dasa
Participant
Posts: 7
Joined: Mon May 12, 2008 5:57 am
Location: near BEML gate

Post by sujatha dasa »

Thnks for ur help.
how to conver '/' to newline .Is there any function for this
SUJA
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Did you bother to search the product documentation? Or search the forum? The function you need has a very obvious name.

Mike
sujatha dasa
Participant
Posts: 7
Joined: Mon May 12, 2008 5:57 am
Location: near BEML gate

Post by sujatha dasa »

Thnks for ur help.
how to conver '/' to newline .Is there any function for this
SUJA
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Search can be found right below the banner.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Read about the CONVERT() function from datastage help.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post by mandyli »

Hi

Try to use Pivot Stage or try to write Unix script to do that.

I hope convert function it will not do this function.


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

Post by chulett »

mandyli wrote:I hope convert function it will not do this function.
Sure it will... write out one record, read back many. There's a FAQ posting on this technique as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
girija
Participant
Posts: 89
Joined: Fri Mar 24, 2006 1:51 pm
Location: Hartford

Post by girija »

Could you please tell us detail about your requirement? If you are selecting only one column from DB2 and try to get the result as you shown then CONVERT can do this. Use Convert function and write into another seqfile, and read the same file in the next job. But if you are selecting multiple column from your source along with the specified column and need the output as you mentioned along with other columns then CONVERT is not the right solution for that.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Does "very argent" mean you're prepared to pay?
: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.
sujatha dasa
Participant
Posts: 7
Joined: Mon May 12, 2008 5:57 am
Location: near BEML gate

Post by sujatha dasa »

Thnks for ur response.

Convert is used to Replaces every instance of specified characters in a string with substitute characters.

but my requirement is i have to convert the data in to the records whereever '/' will come in incomming data.
Iam using only one column in db2.

Eg;

if the data contains like

we
ws/ms/ds
rs/fd/ff/ss/ll
re

i want the output like below
we
ws
ms
ds
rs
fd
ff
ss
ll
re
SUJA
sujatha dasa
Participant
Posts: 7
Joined: Mon May 12, 2008 5:57 am
Location: near BEML gate

Post by sujatha dasa »

Thnks for ur response.

Convert is used to Replaces every instance of specified characters in a string with substitute characters.

but my requirement is i have to convert the data in to the records whereever '/' will come in incomming data.
Iam using only one column in db2.

Eg;

if the data contains like

we
ws/ms/ds
rs/fd/ff/ss/ll
re

i want the output like below
we
ws
ms
ds
rs
fd
ff
ss
ll
re
SUJA
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Convert is used to Replaces every instance of specified characters in a string with substitute characters.

interpret as
Convert is used to Replaces every instance of '/' in a string with 'newline' characters.
Manually think through the function and expected outcome
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? Your question has already been answered and Convert() can do what you need. As noted, this FAQ discusses the same technique.
-craig

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