Conversion Logic in Transformer

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
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Conversion Logic in Transformer

Post by DS_MJ »

Hello:

Need help with what functions to use in Datastage to replace DB2 functions in the below query.

DB2 query: SUBSTR (TRANSLATE (COL, SUBSTR (COL, 5, 1), ' '), 5, 1) ||
SUBSTR (RIGHT ('0' || RTRIM (CHAR (LENGTH (RTRIM (COL)))), 2), 2, 1) ||


Ex: SUBSTR using LEFT
TRANSLATE should I use CONVERT?
CHAR?
LENGTH

Would appreciate if anybody could help complete the below db2 query in datastage.
: LEFT (TRANSLATE (COL, LEFT (COL, 8, 1), ' '), 11, 1) :
LEFT (RIGHT ('0' : RTRIM (CHAR (LENGTH (RTRIM (COL)))), 2), 1, 1) :
Thanks
Thanks in advance,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The functions available are listed in the documentation, should be fairly straight forward to take what you know the DB2 function does and look for a DataStage equivalent in the list. Only thing that might not be obvious is the use of the substring operators "[]" rather than the function that is also available.

Worst case you can just leave these in your DB2 SQL...
-craig

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