Procedure Find control on PH607F AS/400
Latimer, Richard
richard.latimer@airways.co.nz
Mon, 6 Aug 2001 08:33:28 +1200
Hi,
on our system (AS/400, 6.07F) we make extensive use of date ranged lookup
tables.
Example: Rat 1 owns an aeroplane, "ratlet"?? from 1 July 1990 to 30 June
1993 and then sells it to Rat 2. We maintain 2 records in the file :
idy_acft,dte_regstart,idy_owner,dte_regend, etc etc
ratlet, 01/07/1990,rat1,30/6/1993, detail fields x several...
ratlet, 01/07/1993,rat2,31/12/2099, detail fields x several...
Indexes are aeroplane/start date (unique) and owner
Screens (and admittedly we don't use many, only to maintain the tables) are
written something like this :
FILE aircraft REFERENCE
ACCESS VIA idy_acft USING idy_acft OF online_costing
SELECT IF dte_mov OF online_costing >= &
dte_regstart OF aircraft AND &
dte_mov OF online_costing <= &
dte_regend OF aircraft
Your example would have a simpler 'select' statement since you only need
"select if ratlet-no = x"
cheers
Richard Latimer
Wellington MIS Manager
Airways New Zealand
Ph +64 4 471 4744
Fax +64 4 471 0395
**********************************************************************
This electronic message together with any attachments is confidential. If
you receive it in error: (i) you must not use, disclose, copy or retain
it; (ii) please contact the sender immediately by reply email and then
delete the emails. Views expressed in this email may not be those of the
Airways Corporation of New Zealand Limited
**********************************************************************