Page 1 of 1

Hash File

Posted: Wed Mar 30, 2005 4:07 pm
by naren6876
Hi,

Let me put my requirement in this way.

I have source seqfile with ERR_CD and LookUpHash file with ERR_CD,ERR_DESC.
If ERR_CD matches it will write the ERR_CD and ERR_DESC to th target seqfile.While writing the target seqfile
it writes as

ERR_CD ERR_DESC
ERR01 Invalid value.|
ERR02 Invalid value.|

So it appends the '|' character at the end of the ERR_DESC column value, which i dont want.

This ERR_DESC value is coming from the LookUPhsh file.

How do i delete that '|' character.

TIA

Posted: Wed Mar 30, 2005 4:26 pm
by chulett
Lots of ways. One way would be to stop putting the pipe in the field to begin with. :wink:

Other than that, there are several functions that can do that for you. Ereplace is one that is simple to setup and you could use after you pull the value from the hash to replace the pipe with a space or an empty string. It's documented in your online help.

Or use it once during the build of the hash to strip it then and not have to worry about it on every row. :shock:

Hash File

Posted: Wed Mar 30, 2005 4:26 pm
by dnsjain
"|" character can occur in the ouput file based on multiple reasons.
1. You have "|" character in the hash file with the description.
2. You may have "|" character as delimiter in the sequential file.

You need to make sure that it is not there at both places to solve it.

There is another way to remove that character from the output, you can use Trim function. In the transformer add this logic Trim(indata, "|", "A"), where indata is input column.

Dinesh