Informatica "Source qualifier query" - line subquery in Teradata

General

Informatica "Source qualifier query" - line subquery in Teradata

For example Below Is the Informatica "Source qualifier query" ( Database: Teradata )

------------------------------------------------------------------------------------

select * from

(

select a,

case when LENGTH(LTRIM(RTRIM(b)))<9 then 10,

when LENGTH(LTRIM(RTRIM(b)))!=9 then SUBSTR(LTRIM(RTRIM(b)),9-LENGTH(LTRIM(RTRIM(b)3),

when LENGTH(LTRIM(RTRIM(b)))=9 then b

end

as b,

case when LENGTH(LTRIM(RTRIM(c)))<9 then 10,

when LENGTH(LTRIM(RTRIM(c)))!=9 then SUBSTR(LTRIM(RTRIM(c)),9-LENGTH(LTRIM(RTRIM(c)3)

when LENGTH(LTRIM(RTRIM(c)))=9 then c

end

as c,

d,

e,

f

from abcdef) drt,stb

where

drt.a=stb.a

and

drt.b=stb.b

and

drt.c=stb.c

i want to simplify LTRIM,RTRIM functionality used in this query as like.. instead of applying LTRIM(RTRIM(b)) or LTRIM(RTRIM(c)) multiple times i want to find LTRIM(RTRIM(a) once and use the value where ever occurs so that mutiple times processing can be reduced.. so how will i achive that..( Note:- a & c columns are from 'abcdef' table and INformatica SQ_query output columns are a,b,c,d,e,f only)