Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
Is there any way we can convert a character field having Date '120511'(6A) to 20120511(8P 0)
Thanks
You mean by adding the century and making it numeric? Or by going though a proper date routine?
While the former is rather trivial, I think you'll find what you need on the latter option on the links below.
https://www.google.se/search?q=%25date&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a
http://www.mcpressonline.com/tips-techniques/ibm-i-os400-i5os/techtip-date-time-and-timestamp.html
And then there's the API way to go too, see link below.
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/apis/ile4a1TOC.htm
Google's your friend...
Regards,
Paulster
Might want a MONITOR around it, but how about %DEC(%DATE('120511':*MDY0):*ISO)?
Actually I think the character date is *YMD0 format, but Dale is correct on the rest.