Page 1 of 1

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

Posted: Mon Feb 28, 2005 9:41 pm
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

Posted: Mon Feb 28, 2005 10:10 pm
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. :?

Posted: Mon Feb 28, 2005 11:10 pm
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

Posted: Tue Mar 01, 2005 8:42 am
by mandyli
Hi

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


Thanks
Man

Posted: Tue Mar 01, 2005 3:45 pm
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")

Posted: Tue Mar 01, 2005 9:15 pm
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