|
Randy, I have not had occasion to use OPNQRYF in years so you will need to go to the manual for specifics but this should get you started. Your variables need to be CAST into the same field type as the keyed access path fields. In SQL terms if Key1 is Char(10) the following SQL examples show the issue: Where Key1 = &Variable Will not use access path Where Key1 = Cast(&Variable as Char(10) May use access path with Key1 as first key Hope this helps you along the way. Don Tully Tully Consulting LLC -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Randy Stogner Sent: Thursday, January 06, 2005 7:16 PM To: midrange-l@xxxxxxxxxxxx Subject: OPNQRYF Issue All, I have a process that I want to use OPNQRYF to build a file that allows the user to change a range of data. The issue is that the file I'm overriding to has two logicals, one that I would prefer it to use when building the data access path, which is keyed by 5 values {acd(3S0), pfx(3S0), sfx(4S0), xtn(7S0), pcd(3A)} And another which is keyed by 6 values {pcd(3A), fon(8S0), acd(3S0), pfx(3S0), sfx(4S0), xtn(7S0)}. Currently the OPNQRYF process uses the 2nd logical to build it's access path. The main issue with using the 2nd file is that it causes the process the have to read all records that match on the 1st key to get only what's needed in the range. I believe the reason it does this is because I'm concatenating character versions of the numeric values to create the range to compare to 2 chararcter values being passed into my CL. What can I do to get OPNQRY to use the first logical. Or is there anything I can do, keeping in mind that the situation in our shop is such that I can't create a new logical, and the data, at times, is too large to build a view/index during processing. Here's my OPNQRY definition TL0C17 & TL1C17 are the 2 character values passed in; OPNQRYF FILE((MYFILE)) FORMAT(*FILE) QRYSLT('(pcd + *EQ %VALUES(''' || &RCFPGT || ''' ''' || + &RCTPGT || ''')) *AND (TLC17 *GE "' || + &TL0C17 || '") *AND (TLC17 *LE "' || + &TL1C17 || '")') MAPFLD((acdC acd *CHAR + 3) (pfxC pfx *CHAR 3) (sfxC sfx *CHAR 4) + (xtnC xtn *CHAR 7) (TLC17 'acdC *CAT pfxC + *CAT sfxC *CAT xtnC' *CHAR 17)) + OPNSCOPE(*JOB) Thanks, Randy Stogner USA Mobility -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.