sequential file reading with ~# delimiter

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
marpadga18
Premium Member
Premium Member
Posts: 96
Joined: Fri Aug 20, 2010 8:51 am

sequential file reading with ~# delimiter

Post by marpadga18 »

Hi
my data is like this


abc~#asdf~#hdsajds
the delmiter is ~# how do we read this I tried giving the delimiter as ~# but it is reading #also how to avoid this

Thanks
M
Last edited by marpadga18 on Thu Jul 05, 2012 8:18 am, edited 1 time in total.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

In your sequential file stage, specify Format -> Record Level -> Record Delimiter String as "~#" (without the quotes).
marpadga18
Premium Member
Premium Member
Posts: 96
Joined: Fri Aug 20, 2010 8:51 am

Post by marpadga18 »

abc~#asdf~#hdsajds

these are the column names how to import the sqeuential file table definition. I tried with sequential file table definitions but not working.

Any ideas really helpfull
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I assumed those were line terminators, not column delimiters.
Change your sequential stage to declare "~#" as your Field Delimiter String.
srinivas.g
Participant
Posts: 251
Joined: Mon Jun 09, 2008 5:52 am

Post by srinivas.g »

use the sed command to replace ~# to comma delimiter and call sed command in filter property. Make sure insided the data you should not have same pattern (~#).
Srinu Gadipudi
ssreeni3
Participant
Posts: 29
Joined: Fri May 18, 2012 1:35 am

Post by ssreeni3 »

Hi,

Need to run any script?Or use external filter/seq file options?Please give clarity regarding this.Where should we write sed command to resolve this?

Thanks in advance
Sreeni
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There's no need to do anything external if you use Arnd's solution.

The solution from srinivas.g requires that the file be pre-processed - it does not matter where.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply