October 14

0 comments

How to change MMDDYY to CYYMMDD in one line of RPGLE

By NickLitten

October 14, 2008

RPG, date, snippet

Rpg code snippet

Here’s one to change a 6,0 numeric date in MMDDYY form to 7,0 numeric date in CYYMMDD form.

Eval INTERNAL_DATE = %dec(%char(%date(EXTERNAL_DATE:*mdy) :*cymd0):7:0)

INTERAL_DATE is the 7,0 CYYMMDD date.

EXTERNAL_DATE is the 6,0 MMDDYY date.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Join the IBM i Community for FREE Presentations, Lessons, Hints and Tips

>