Re: [*EXTERNAL*] File keyed on a date field: the read doesn't actually get anything! What am I doing wrong?

Charles Wilt <[email protected]>
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <CAJ=Tnc7sDM-iM4NbhKvBq2-7_29P2zMVs1Tmu9Nfwqo+Zv2q4A@mail.gmail.com>
Do you have DATFMT(*ISO) specified?
"When initializing Date or Time data type fields or named constants with
Date or Time values, the format of the literal must be consistent with the
default format as derived from the Control specification, regardless of the
actual format of the date or time field.

Date literals take the form D'xx-xx-xx' where:
D indicates that the literal is of type date
xx-xx-xx is a valid date in the format specified on the control
specification (separator included)
xx-xx-xx is enclosed by apostrophes

Charles

On Wed, Jan 7, 2026 at 1:35 PM James H. H. Lampert via RPG400-L <
[email protected]> wrote:

> On 1/7/26 12:29 PM, Rick Rauterkus wrote:
> > Are you putting a value into JAN31?  If not, you are just positioning to
> > the beginning of the file and reading the previous record which won't
> find
> > anything.
>
> Yes. It's got a value (my apologies for not saying so earlier). The
> INZ(D'2017-01-31') clause on the declaration would have wrapped in the
> email.
>
> And it has three friends, all of them INZ'd to different dates.
>
> This excerpt is from a test program, after the real program exhibited
> the symptom; it uses a date value constructed from month, day, and year
> values read from a file.
>
> --
> JHHL
>
> --
> This is the RPG programming on IBM i (RPG400-L) mailing list
> To post a message email: [email protected]
> To subscribe, unsubscribe, or change list options,
> visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: [email protected]
> Before posting, please take a moment to review the archives
> at https://archive.midrange.com/rpg400-l.
>
> Please contact [email protected] for any subscription related
> questions.
>
>
-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact [email protected] for any subscription related questions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.