Contains Terminators

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
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Contains Terminators

Post by rwierdsm »

Folks,

I'm trying to find where in a parallel sequential file stage I can specify 'Contains Terminators' as I would in a server job.

Is there such a beast?

Rob Wierdsma
Rob Wierdsma
Toronto, Canada
bartonbishop.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I do not believe that there is.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Re: Contains Terminators

Post by kris007 »

rwierdsm wrote:Folks,

I'm trying to find where in a parallel sequential file stage I can specify 'Contains Terminators' as I would in a server job.

Is there such a beast?

Rob Wierdsma
Wierd,
I was also facing the same problem and opened the site to post the same message.. I saw your post. I know its wierd ( :) , sorry for the pun).
I am trying to solve the problem right now by writing a custom sql and using nested replace

Code: Select all

replace(replace(a.ADDRESS_ID ,chr(13)),chr(10))
but beware if you are doing that for date field which has time in it ,you might want to do to_char(date_field, 'format') before using it in replace() because it chops off time portion and also converts the format from
10/11/2002 8:36:00 pm to just 11 OCT 02.. :( .
If you find a simpler way please let us know.

IHTH
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Re: Contains Terminators

Post by rwierdsm »

kris007 wrote: If you find a simpler way please let us know.

IHTH
Kris,

Unfortunately, my task does not allow me to remove the embedded carriage returns, I need to maintain the format of the large text fields I am receiving. As a result, any eventual solution is not likely to aid you in your situation.

I've been flipping between EE and Server to determine a solution, unfortunately, I need the functionality found in both!

Rob Wierdsma
Rob Wierdsma
Toronto, Canada
bartonbishop.com
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Re: Contains Terminators

Post by bcarlson »

rwierdsm wrote:Folks,

I'm trying to find where in a parallel sequential file stage I can specify 'Contains Terminators' as I would in a server job.

Is there such a beast?

Rob Wierdsma
For those of us who have not used Server before, what is 'Contains Terminators'?

Thanks for the info,

Brad.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

It is "Sweet" option that is present in the Sequential file stage that lets it know that it is not a line terminator. And so the sequential file stage doesnt end the row there.
Use this to specify how End of Record (EOR) marks are to be treated in this column.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

So if I have a pipe-delimited file and a column actually has a pipe in it (as part of the data), the 'contains terminators' won't use the 'internal' pipe to parse the data? Or is it specific to carriage returns?

Brad.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Its specific to carrige returns.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Post by rwierdsm »

Actually the more general case of UNIX and DOS EOR indicators (i.e. both x0A and x0D0A - and perhaps others?!?!?)

Rob
Rob Wierdsma
Toronto, Canada
bartonbishop.com
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Rob, you can try writing a dos batch job that replaces all carrige returns with a space. Then reads in x number of characters (x= number of columns in a row) and characters would be your delimiter, and then put a carrige return. This way you can cleanse the data.
Just a thought. Not the best way but atleast something to fall back upon.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Post by rwierdsm »

Thanks, Guru!
Rob Wierdsma
Toronto, Canada
bartonbishop.com
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Re: Contains Terminators

Post by kris007 »

rwierdsm wrote: I've been flipping between EE and Server to determine a solution, unfortunately, I need the functionality found in both!

Rob Wierdsma
In that case if the data is really not big or if performance is not a big criteria you might wanna use server jobs for that.
or as DSGURU2B suggested, try prep'ing the data even before sequential file stage reads it.
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Re: Contains Terminators

Post by rwierdsm »

kris007 wrote:In that case if the data is really not big or if performance is not a big criteria you might wanna use server jobs for that.
or as DSGURU2B suggested, try prep'ing the data even before sequential file stage reads it.
Hi Kris,

I have been trying to solve this issue going down both paths, EE and Server. I'm actually leaning back to Server again.

Another option is to get the extract done in fixed width, however, some of the fields are LongVarchar(32700) :shock:
Most of the source rows will have many fewer characters than that and I don't want to bloat the file if it isn't necessary.

In terms of prepping the data, I can get the extract folks to give me whatever I want, however, first I have to find out what I want :!:

Of course what I want is what will work in DS.....

Still kicking this one around......

Thanks for all your ideas, guys (and gals!)

Rob Wierdsma
Rob Wierdsma
Toronto, Canada
bartonbishop.com
Post Reply