TIMESTAMP CONVERSION
Moderators: chulett, rschirm, roy
TIMESTAMP CONVERSION
Hi All,
I am trying to populate string data in to timestamp.
my source data format is YYMMDDHHMMSSSS ,
i need to populate this data in to target table having timestamp YY-MM-DD HH:MM:SS.
To Achive this output i have been using this function
"OCONV(ICONV(TRIM(INPUT_COLUMN[1,8]),"D4YMD[4,2,2]"), "D-YMD[4,2,2]") : " " : OCONV(ICONV(TRIM(INPUT_COLUMN[9,2]:":":INPUT_COLUMN[11,2]:":":INPUT_COLUMN[13,2]), "MTS"), "MTS")".
But data in target table populating as null !
Does i need to change my code?
I am trying to populate string data in to timestamp.
my source data format is YYMMDDHHMMSSSS ,
i need to populate this data in to target table having timestamp YY-MM-DD HH:MM:SS.
To Achive this output i have been using this function
"OCONV(ICONV(TRIM(INPUT_COLUMN[1,8]),"D4YMD[4,2,2]"), "D-YMD[4,2,2]") : " " : OCONV(ICONV(TRIM(INPUT_COLUMN[9,2]:":":INPUT_COLUMN[11,2]:":":INPUT_COLUMN[13,2]), "MTS"), "MTS")".
But data in target table populating as null !
Does i need to change my code?
Re: TIMESTAMP CONVERSION
You can use the following function to convert the date into desired format DD[1,2]:'-':DD[3,2]:'-':DD[5,2]:' ': DD[7,2]: ':' :DD[9,2]: ':' :DD[11,2]
*Note: Smilies disabled in post - Content Editor*
*Note: Smilies disabled in post - Content Editor*
Nirdesh Kumar
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Iconv() is clever enough not to need format information.
Code: Select all
Iconv(Left(InLink.TheString,6),"DYMD")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.