temp delimited files that contains the delimited character

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
nima
Premium Member
Premium Member
Posts: 14
Joined: Wed Feb 04, 2004 9:40 pm

temp delimited files that contains the delimited character

Post by nima »

Hi,
Storing extracted data into (temporary) delimited files for subsequent processing within a DataStage job seems to be problematic when the data contains the delimiting character or embedded <CR><LF>.

I am wondering if there is a way around this problem.


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

Post by Sainath.Srinivasan »

When the data contains delimiter char, use a different delim char.

When the data contains line terminator, use convert to replace to blank.
nima
Premium Member
Premium Member
Posts: 14
Joined: Wed Feb 04, 2004 9:40 pm

Post by nima »

Sainath.Srinivasan wrote:When the data contains delimiter char, use a different delim char.

When the data contains line terminator, use convert to replace to blank.

Thanks for the reply. The problem is that we do not know before hand if the data includes the delimiter character or not.

Cheers Nima
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Actually, if you define a quote character for your string data you can have any number of occurrences of your delimiter character (as well as your quote character).

The difficulty is with your line terminator character, the parsing algorithm cannot tell the difference between an embedded character and a true line break. If you know you will have line or record terminators in your data then the easiest solution is to define your data as fixed length and remove both quote and terminator characters -- that way DS just reads and writes <line-length> characters per record irrespective of the contents. Not necessarily a great solution if you have a varchar(1024) column that only contains 4 characters, but it does work.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Use a hash file. Should not be a problem to have CR/LF. It will slow it down but it will not change the column.
Mamu Kim
nima
Premium Member
Premium Member
Posts: 14
Joined: Wed Feb 04, 2004 9:40 pm

Post by nima »

Thank you very much for the replies. I was away for a week and could not check out your responds.

cheers nima
amsh76
Charter Member
Charter Member
Posts: 118
Joined: Wed Mar 10, 2004 10:58 pm

Post by amsh76 »

In the Sequential File Stage, within the column properties....you can specify whether that column contains the line terminator.

Once you read the file successfully..you can use the convert function to convert the line terminator into space or some other character.
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

You can use field delimiter, which cannot be entered by a single key in the keyboard. So that the chances are very minimal to have the delimited string unless your source application has specific requirement to store that.

Regards
Saravanan
Post Reply