ICONV and OCONV functions are quite often used to handle data in Datastage.
ICONV converts a string to an internal storage format and OCONV converts an expression to an output format.
ICONV converts a string to an internal storage format and OCONV converts an expression to an output format.
Syntax:
Iconv (string, conversion code)
Oconv(expression, conversion )
Iconv (string, conversion code)
Oconv(expression, conversion )
<Karthi> This function available only in server job, not in parallel jobs.
The following example show date conversions from external to internal format. All of these ICONV functions return the internal date 14143 :
OCONV
The following example shows date conversions:
DateConversions: ! Month Abbreviation Formats: PRINT OCONV(0,"D"); ! "31 DEC 1967" PRINT OCONV(14100,"D"); ! "08 AUG 2006" PRINT OCONV(14100,"D2"); ! "08 AUG 06" PRINT OCONV(DATE(),"D"); ! current date in above format PRINT OCONV(@DATE,"D"); ! current date in above format PRINT OCONV(14120,"D-") ! "08-28-2006" PRINT OCONV(14120,"D/") ! "08/28/2006" PRINT OCONV(14120,"DE") ! "28/08/2006" PRINT OCONV(14120,"D2/") ! "08/28/06" PRINT OCONV(14120,"D2-E") ! "28-08-06"
No comments:
Post a Comment