Trim Char Datatype

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
tkbharani
Premium Member
Premium Member
Posts: 71
Joined: Wed Dec 27, 2006 8:12 am
Location: Sydney

Trim Char Datatype

Post by tkbharani »

Hi

I am trying to TRIM the Char datatype in Transformer stage.
Process
---------
Output column from teradata isCHAR datatype. At times when lookup fails the column will not be populated(It must be NULL). BUT when I try to check it for NULL or '' , its not working. When i check the length of the column its always 4, though in unix its is NULL.

I tried
TRIM(inputcolumn,'','D') -Not working
Convert() not working.

Any way to Trim the CHAR datatype , so that I can check IsNull function.

Thanks
Thanks, BK
hamzaqk
Participant
Posts: 249
Joined: Tue Apr 17, 2007 5:50 am
Location: islamabad

Post by hamzaqk »

How are you extracting data from TD?? are you specifying a query to pull out data? if yes to the TRIM in the query.
Teradata Certified Master V2R5
tkbharani
Premium Member
Premium Member
Posts: 71
Joined: Wed Dec 27, 2006 8:12 am
Location: Sydney

Re: Trim Char Datatype

Post by tkbharani »

Hi

I just used a copy stage between Teradatastage and Lookup stage, input column is CHAR and same column in output is VARCHAR. As I am checking for IsNull() its working fine.
If still there is way of triming in it transformer , please reply.
Thanks, BK
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can't trim a CHAR.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply