Page 1 of 1

Conversion Logic in Transformer

Posted: Thu May 30, 2013 1:00 pm
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

Posted: Thu May 30, 2013 1:52 pm
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...