.st0{fill:#FFFFFF;}

How to change MMDDYY to CYYMMDD in one line of RPGLE 

 October 14, 2008

By  NickLitten

Heres 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.

Convert RPG Datefield %DATE into a signed numericTo convert a RPG DATEFIELD to this numeric 8,0 field with no ‘/’ or ‘-‘ do this: D USADate 8s 0 US…Jul 11 2017www.nicklitten.com

add days to 100 Year date from EXCEL using RPGSo, we had a file coming in from an external partner today – containing a date in Julian Format. Or …Jul 11 2017www.nicklitten.com

RPG Code Snippet

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

Swap Homes and Travel the World – Join Home Exchange
Surf the Web Securely with OPEN DNS
IBM i Software Change Management – CMS vs ALM – What’s in a Name?
Want to learn CL Programming?
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Get In Touch

I’m always looking for awesome input, feedback and critique!

>

Snug CBD

 20% Discount

I have partnered with SNUG CBD givING you Organic CBD
20% discount code "NL20"