9/9/11

Datastage Transformations

Server Job Transformations:  
1)To remove the zeroes from left
function : Trim(columnName,'0','L')  
2) To remove the zeroes from left
function : Trim(columnName,'0','R')
3)Create spaces or create zeroes(padding) before or after the Input value
Fmt(KeyMgtGetNextValue (DSJobStartTime),"8'0'R")
Example :
If Input : "1234"
desired output : "00001234"
If i/o : "123"
o/p will be:"00000123"

Parallel Job Transformations :
To Handle the Spaces or Nulls etc:
UpCase ( Trim ( Convert ( Char (0) : Char(10) : Char(13) : Char(124), "    ", DSLink1.InColumn) ) )


Sequence Job Transformations:
Command Stage :  
List out the files with comma(,)
ls -m #$FilePath##FolderPath# |tr '\n' ','| sed '$s/,$//'


Use Sql in Command Stage : 
Ex : 
command:
nzsql (Netezza)

Parameter:

-host #$jpNZ_SERVER# -db #$jpNZ_DB_DB# -u #$jpNZ_USERID_DB# -pw #$jpNZ_PWD_DB# -t  -c "SELECT STRT_TMSTMP FROM #$jpNZ_DB_DB#.#$jpNZ_
TABLE_OWNER#.EXTRACT_DRIVER WHERE PROC_NM='XYZ' "