Padman Kumar <padmancp@wipsys.ge.com> wrote:

>yes u're right.i have two access paths.i have defined two
>fields as key in the physical file.i want to read records from
>database using these two keys. i think u're clear now.

As mud :-)

>then please suggest in which way i can effectively handle these
>two keys.

Padman,

>From what you say, I think you only have one access path. I'm guessing to
some extent, but I think your mistake is as follows.

Say your physical file is called PADMAN and it was keyed by FIELDA. You
wanted to be able to access it either by FIELDA or FIELDB. So you defined
FIELDB as an additional key within PADMAN. You now have a single access
path using a compound key. When you want to read by FIELDA you move a value
to FIELDA and use FIELDA to chain to PADMAN. It works.  :-)  Now you want
to read by FIELDB so you move a value to FIELDB and use FIELDB to chain to
PADMAN. It doesn't work because the program thinks you want to use the
value in FIELDB as a partial key to access PADMAN through its single access
path. As you've used a single field in the chain it assumes you want to use
the first key field, which is FIELDA, not FIELDB.  :-(

What you need to do is to put PADMAN back the way it was, with only FIELDA
as a key field. Next define a logical file PADMANL1 specifying PADMAN as
its PFILE, and with FIELDB as the key field. Define both files in your
program. When you want to read by FIELDA use PADMAN. When you want to read
by FIELDB use PADMANL1.

Dave Kahn, ABB Steward Ltd.


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.