8/3/12

Different padding functions in Datastage




Padding with spaces or zeroes:


  • Str(" ", 50 - Len(inputcolumn)) : inputcolumn



in above example,50 is the total lenghth of the Target filed
if the input value have 10 charaters so the above function will replace the remaining 40 with spaces
Output Looks like : "xxxxxxxxxx                                             "


  • Str("0", 50 - Len(inputcolumn)) : inputcolumn


in above example,50 is the total lenghth of the Target filed
if the input value have 10 charaters so the above function will replace the remaining 40 with zeroes

Output Looks like : "xxxxxxxxxx000000000000000000000000000"


  • Right(STR('0',18):inputcolumn,18)
  • Right('0000':inputcolumn,4)



0 comments:

Post a Comment