10 pts.
 formatting date of 1070112 as 12-01-2007
I am having the date format of 1070112(yyddmm), which i've to convert into the form of 12-01-2007(ddmmyyyy)using RPGLE.

Software/Hardware used:
ASKED: February 20, 2008  11:26 AM
UPDATED: February 20, 2008  2:59 PM

Answer Wiki:
Assuming that your input value of '1070112' is really CYYMMDD (your question has it as YYDDMM but you show a desired answer of DDMMYYYY 12-01-2007...) then the following should do the trick: <pre> dCYMDField s 7 inz('1070112') /free dsply (%editw(%dec(%date(CYMDField :*CYMD0) :*EUR) :'0 - - ')); *inlr = *on; return; /end-free </pre> this will result in: DSPLY 12-01-2007 being displayed. Bruce Vining <a href="http://www.brucevining.com/">http://www.brucevining.com/</a>
Last Wiki Answer Submitted:  February 20, 2008  2:59 pm  by  bvining   6,055 pts.
All Answer Wiki Contributors:  bvining   6,055 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _