Hi Gurus,
We have date from source in packed format the data type is
S(9) 7 COMP-3 and it will always be 7 chr long. Below is the few conversion
1060101 2006-01-01
0060101 1906-01-01
-1060101 1806-01-01
I tried every sort of onversion but somehow not able to get results.
Regards,
Date Conversion
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 145
- Joined: Fri Sep 21, 2007 9:35 am
- Location: Boston
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Except that, when there's a sign, it's eight characters long.
The year is given by something like
The month and day can be extracted using integer division and remainder or by substring techniques.
Then re-assemble the date as a string and, if required, convert that to a Date data type.
The year is given by something like
Code: Select all
2000+Mod(InLink.TheInteger,1000000)+Mod(Int(InLink.TheInteger/1000000),10000)
Then re-assemble the date as a string and, if required, convert that to a Date data type.
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.
-
- Participant
- Posts: 137
- Joined: Sun Jan 07, 2007 11:17 pm
- Location: VISAKHAPATNAM