how to convert a one column input to multiple column

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
ashokkumarss
Participant
Posts: 4
Joined: Tue May 20, 2014 4:05 am
Location: chennai
Contact:

how to convert a one column input to multiple column

Post by ashokkumarss »

hi i have situation like below.
I/P
NAME
ssak

O/P

NAME
s
s
a
k

how do i do this.. pls guide me..
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

When is the interview?
ashokkumarss
Participant
Posts: 4
Joined: Tue May 20, 2014 4:05 am
Location: chennai
Contact:

Re: how to convert a one column input to multiple column

Post by ashokkumarss »

already attended.. and myself also need to get clarification on this.. how to do it transformers.. if other languages like c, cpp worked.. but not in ds.. pls dont tease me, if possible clarify ..
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi,

Please let us know what was your approach to get the output.
ashokkumarss
Participant
Posts: 4
Joined: Tue May 20, 2014 4:05 am
Location: chennai
Contact:

Re: how to convert a one column input to multiple column

Post by ashokkumarss »

its its multiple columns to multiple rows, instead of pivot stage i will use transformers and use loop variable and do that..

or else, if the input was like s,s,a,k.. then i use str function and its possible to split

but here, im little bit confused

or in the tension i may unable to find out the solution.. pls guide me in this situation..

i need guidance to solve this kind of inputs...
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

This is a good place to use the loop functionality in a Transform stage.

In the Loop While condition put in "@ITERATION <= LEN(InColumn.InputString)"

Then in the Output just specify "InColumn.InputString[@ITERATION,1]" to put one character per row
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What's the business case behind the requirement? That may assist in deciding the most appropriate algorithm - there are at least five different ways to solve this one.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ashokkumarss
Participant
Posts: 4
Joined: Tue May 20, 2014 4:05 am
Location: chennai
Contact:

Re: how to convert a one column input to multiple column

Post by ashokkumarss »

got the idea how to do it.

get the input in stage variable
len(inputcol) = stagevariabl

looping

@iteration = stagevariable

right(left(inputcol,@iteration),1) - loopvar

loopvar - O/P

with guidance through my friend.
oracle
Participant
Posts: 43
Joined: Sat Jun 25, 2005 11:52 pm

Post by oracle »

prasson_ibm wrote:When is the interview?
Learn from Ray,andrw how they responded...don't discourage if some one genuinely wants to learn.
Post Reply