Page 1 of 1

Datastage Transformer Null handling

Posted: Thu Sep 16, 2010 7:20 pm
by walter.mitterer
Hi All,

I am using datastage 8.1 and have issues with null handling.

In a Transformer, have an input filed as Varchar. The output from the Transformer is varchar.

The Output is then used to update an Oracle table.

The following are the rules with examples:

Input value Output value

Smith Smith
(null) (null)
Space (null)
Smith with trail spaces Smith (without spaces)

The questions:

1. Is there a function in datastage that will give me Null as a result of removing all the blanks from a field?
2. Using TRIM on the 3rd example, what is the result? Empty String or Null string ?
3. Is there a function to turn Empty to Null?
4. What functions can I use to get the above, if I am using stage variables ( that can not be nulls)?

Thanks in advance.


Regards, Walter

Posted: Thu Sep 16, 2010 7:55 pm
by kris007

Code: Select all

If IsNull(InputValue) or Trim(InputValue) = '' Then SetNull() Else Trim(InputValue)
That should do it.