Write data to Seq. File - Remove Additional Delimeter in it

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
rajeev_prabhuat
Participant
Posts: 136
Joined: Wed Sep 29, 2004 5:56 am
Location: Chennai
Contact:

Write data to Seq. File - Remove Additional Delimeter in it

Post by rajeev_prabhuat »

Hi,

We have a job which takes data from Oracle 9i stage and writes data to sequential file (It has only very small amount of data less than 20 rows). I am using Delimter as command and Quote as double and writing the data to the Seq. File. In the next job i am reading the seq. file and i was not getting the data properly, on ananlysis we found that in one of the column which is a character fiels has newline character (\n) in between the data which is creating problem while reading the data from the file. It reads the data of only those records which does not have the newline character and writes to the target Oracle stage another table. But i want the data to read by eliminating this new line character and write to the target.

Can anyone help me geting a correct solution for the same.

Regards,
Rajeev Prabhu
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If it was a Server job, I'd tell you to remove the newline in the derivation of the field by using Ereplace, for example:

Code: Select all

EReplace(YourField,CHAR(10)," ",-1,0)
This would replace all newline characters in the field with a space. I'm assuming there must be something equivalent in PX so you don't have to drop a BASIC Transformer into the job just to do something like this. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
rajeev_prabhuat
Participant
Posts: 136
Joined: Wed Sep 29, 2004 5:56 am
Location: Chennai
Contact:

Post by rajeev_prabhuat »

chulett wrote:If it was a Server job, I'd tell you to remove the newline in the derivation of the field by using Ereplace, for example:

Code: Select all

EReplace(YourField,CHAR(10)," ",-1,0)
This would replace all newline characters in the field with a space. I'm assuming there must be something equivalent in PX so you don't have to drop a BASIC Transformer into the job just to do something like this. :?
Hi Chulett,

Thankyou this is working fine in Server job, but i tried the same in PX but there is no such Function "Ereplace" in PX, can anyone given in equvalent for EReplaace that can be used in PX.

Regards,
Rajeev Prabhu
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post by mandyli »

Hi

please read from sql use same things in source file stage.


Thanks
Man
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

Trim() can do it. Convert() can do it. Each works in a different way -- just depend on what you want to do. You will need to pass a hex value of the newline character in order for that to work with newline character.

("0xblah")
rajeev_prabhuat
Participant
Posts: 136
Joined: Wed Sep 29, 2004 5:56 am
Location: Chennai
Contact:

Post by rajeev_prabhuat »

T42 wrote:Trim() can do it. Convert() can do it. Each works in a different way -- just depend on what you want to do. You will need to pass a hex value of the newline character in order for that to work with newline character.

("0xblah")
Hi,

Thankyou i will try this out.

Regards,
Rajeev Prabhu
Post Reply