Infosphere DataStage – How To Convert Char(0)

IBM Infosphere DataStage Transformer Convert Char(0)
DataStage Transformer Convert Char(0)

Char(0) is a common hidden character, which sometimes needs to be dealt with to ensure lookups function correctly and other reasons.  The convert function can be used to replace Char(0) or other values as necessary.  Within a DataStage transformer stage the process is straight forward enough, so, here are some examples to get you started.

What is Char(0)

  • In a nutshell char(0) is a null value character or null terminator (identifying the end of a string)

Convert Syntax

convert(‘<<Value to be replaced’,'<<Replacement value >>’,<<Input field>>)

Convert Char(0) Format

convert(char(0),<<Replacement value >>,<<Inbound field>>)

Convert Char(0) Examples

  • This example replaces Char(0) with nothing essentially removing it as padding and/or space.

convert(char(0),”,Lnk_Src_Stg_Status_Code.runtypecode)

  • This example, replaces Char(0) with a space

convert(char(0),’ ‘,Lnk_Src_Stg_Status_Code.runtypecode)

  • This example, replaces Char(0) with a tilde

convert(char(0),’~’,Lnk_Src_Stg_Status_Code.runtypecode)

Related References