We need to change the string to specific date format in User Variable Activity.
One option would using OCONV function
Input string coming in as 20120731
Expected Output : 31-AUG-2012
Can you please let me know what format do I need use in the function
Oconv(Inputvalue, format)
What are other options available to convert string to date in User variable activity
Thanks
Change the string to specific date format in User variable
Moderators: chulett, rschirm, roy
There are actually 2 step involved, first you need to parse the string value into the internal date format, then output that internal date as a string
I'm not at a PC where I can check the syntax, but it should be close enough and the descript can be found at http://publib.boulder.ibm.com/infocente ... ction.html
Code: Select all
OCONV(INCONV(UserVariable[1,4]:'-':UserVariable[5,2]:'-':UserVariable[7,2],'D4-YMD'),'D4-DMY[2,A3,4]')
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Are you looking for the end of the next month or the corresponding day (date) in the next month?
I don't believe Arnd's parsing is necessary; Iconv("20120731","D4YMD") should work correctly. After that, something like the MONTH.LAST Transform might be what you are looking for.
I don't believe Arnd's parsing is necessary; Iconv("20120731","D4YMD") should work correctly. After that, something like the MONTH.LAST Transform might be what you are looking for.
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.
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore