Hash File

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
naren6876
Participant
Posts: 233
Joined: Mon Feb 07, 2005 7:19 pm

Hash File

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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:
-craig

"You can never have too many knives" -- Logan Nine Fingers
dnsjain
Charter Member
Charter Member
Posts: 34
Joined: Thu May 08, 2003 2:12 pm

Hash File

Post 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
Post Reply