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

"James H. H. Lampert via RPG400-L" <[email protected]>
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <[email protected]>
On 1/7/26 12:38 PM, Dan Bale via RPG400-L wrote:
> Per your update, JAN31 = D'2017-01-31'
> 
> Stupid question, but are there any records with a SMLASTDATE date earlier than D'2017-01-31'?

Not a stupid question at all. (My high school woodshop teacher was fond 
of saying that the only dumb question is the one that doesn't get asked.)

The first record in the PF (which is the last one in the descending LF) 
is keyed D'2017-02-04.' The last record in the PF (which is the first in 
the LF) is keyed 2028-12-30.

And my four test key fields have INZ clauses of

    INZ(D'2017-04-25')
    INZ(D'2017-01-31')
    INZ(D'2017-02-04')
    INZ(D'2017-02-05')

on their D-specs.

If I were using the descending logical, JAN31 should have retrieved 
nothing at all, but the other three should have retrieved *something.*

I get the same results whether the key (theoretically) should get a hit 
or not, whether it's the ascending PF or the descenging LF, whether I 
use a SETGT or a SETLL, and whether I use a READ or a READP. SMLASTDATE 
always comes up D'0001-01-01'.

--
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: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org 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.