formatting date of 1070112 as 12-01-2007

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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: