Read "|" delimited data from a java code.

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
chetan.c
Participant
Posts: 112
Joined: Tue Jan 17, 2012 2:09 am
Location: Bangalore

Read "|" delimited data from a java code.

Post by chetan.c »

Hi All,

I have a java transformer stage which is giving output as below.

Code: Select all

col1|col2|col3...
data1|data2|data3|
.
.
I want to recieve this data and use this for a join.
Currently the java code is giving the output as a string.
Do I need to split data there into different columns or split string later with a different stage?
If i have to split data into columns what is the stage that I must be using?

Thanks,
Chetan.C
chetan.c
Participant
Posts: 112
Joined: Tue Jan 17, 2012 2:09 am
Location: Bangalore

Post by chetan.c »

Currently trying out column inport stage.
But want know how recieve the data as seperate columns from the Code.

Thanks.
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

You can change your JAVA code to return multiple columns as output. I have seen this in at least 1 project.
Kandy
_________________
Try and Try again…You will succeed atlast!!
chetan.c
Participant
Posts: 112
Joined: Tue Jan 17, 2012 2:09 am
Location: Bangalore

Post by chetan.c »

So column export is not a good option?

Thanks,
Chetan.C
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

chetan.c wrote:But want know how recieve the data as seperate columns from the Code.
I answered your question but did not say that it is the best method. Anyways, column export can't be used for your case. It's column import to split one field into multiple. You can also use transfomer stage but you need to decide based on requirements & downstream transformations.
Kandy
_________________
Try and Try again…You will succeed atlast!!
chetan.c
Participant
Posts: 112
Joined: Tue Jan 17, 2012 2:09 am
Location: Bangalore

Post by chetan.c »

Yes right.
I am using column import itself, it was typo.

Now splitting into columns at code itself.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Definitely change the java class if you can...it can easily send it's output in multiple rows and individual columns.....

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply