On Tue, Aug 2, 2011 at 5:32 PM, Timothy Adair <tadair@xxxxxxxxxxxxxxxx> wrote:
In the printer output specs of my program, I am attempting to
suppress the leading zero on a *DATE field.  According to
the RPG ILE manual (v6r1) I should be able to do this with
a "Y" edit code.

Edit codes only apply to numeric fields, as your error message
indicated. The date type is not a numeric type. (Someone will
correct me if I'm wrong, but I believe In the old days, there was no
date type, so usually dates were stored as a number, which allowed use
of edit codes or edit words to modify how they were displayed. This
practice is still very common today.)

If you want to use edit codes, you will have to convert your date
field to a numeric type first. You can do this simply with MOVE, or
you can use built-in functions.

If reformatting dates for output is something you will be doing a lot
(and I would think it is), then my recommendation would be to bite the
bullet and write some date routines that you will use over and over
again. (I've done this to allow more flexible editing, such as
omitting the leading zero for both the day and the month, as Excel
normally does.)

John

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.