AS/400 QUICK Record Selection

Merol Newman merol.newman@ramesys.com
Fri, 2 Nov 2001 21:55:52 -0000


Hello Daniel

If rats to ratlets is 1:1, and you don't need to retrieve rats which have no
ratlets, you could select on a non-optional secondary file.

FILE RATS occurs 9
        select if 0 ne index(RATNAME of RATS,trunc(t-RAT-NAME))

FILE RATLETS secondary occurs with RATS
        access via RAT-NO using RAT-NO of RATS
        select if RATLET-DOB of RATLETS eq t-RATLET-DOB

Having changed the file statements as above, do BUILD LIST DETAIL to produce
the FIND procedure. You'll find the GET on RATLETS is OPTIONAL. Remove the word
"optional", and I think it will work. But I haven't tested it - it's sad enough
that I want to send you this on a Friday night instead of going home!

Bye
Merol

merol.newman@ramesys.com
Ramesys, Eldon Way, Crick, Northamptonshire, UK. NN6 7SL
phone 01788 822133/823831, fax 01788 823601


> -----Original Message-----
> From: powerh-l-admin@cube.swau.edu
> [mailto:powerh-l-admin@cube.swau.edu]On Behalf Of Daniel Mielke
> Sent: 02 November 2001 20:58
> To: Powerhouse List (E-mail)
> Subject: AS/400 QUICK Record Selection
>
>
> Hello All,
>
> I need help in selecting records for display.  I want to select specific
> records from a primary file based on records in associated reference files.
>
> TEMP t-RAT-NAME char*20
> TEMP t-RATLET-DOB zoned*8
>
> FILE RATS occurs 9
> 	select if 0 ne index(RATNAME of RATS,trunc(t-RAT-NAME)) &
> 	and RATLET-DOB of RATLETS eq t-RATLET-DOB
>
> FILE RATLETS reference
> 	access via RAT-NO using RAT-NO of RATS
>
> ;There may be no RATLETS for a given RAT
> ;There is no index for RATNAME so the GET statement will be SEQUENTIAL
>
> QUICK gives an Error stating that it can't find RATLET-DOB, and rightly so,
> it hasn't been declared yet.  How do I control the selection of a RATS
> record based on data in the referenced file RATLETS?
>
> I was thinking of modifying the FIND or POSTFIND procedures, but I'm not
> sure how to start.
>
> Help!
>
> > BUY. HOLD. AND PROSPER.
> >
> > Daniel Mielke
> > Senior User Analyst
> > AIC Limited
> > 1-888-710-4242 (4614)
> > dmielke@aicfunds.com
> > www.aicfunds.com
> >
> >
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Mailing list: powerh-l@lists.swau.edu
> Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
> Unsubscribe: "unsubscribe" in message body to powerh-l-request@lists.swau.edu
> http://lists.swau.edu/mailman/listinfo/powerh-l
> This list is closed, thus to post to the list you must be a subscriber.
>