Datastage Transformer Null handling

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
walter.mitterer
Participant
Posts: 1
Joined: Tue Sep 14, 2010 9:52 pm

Datastage Transformer Null handling

Post 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
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Code: Select all

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

Where's the "Any" key?-Homer Simpson
Post Reply