Thomas,
i had to go look at a system running some opnqryf to refresh my memory -
this was RPGII code with /S36 procs converted to RPGIV and CLP (mostly
1998,, and most recent is 2002..and it's the customer that made decision
not to modernize this code since then ...
You have not shown your code so i'll show mine and ask questions, and the
matching record seems not relevant to the issue
btw - I always CLOF before the OPNQRYF, just in case prev execution issues
in the same job

CLOF OPNID(WO)
MONMSG MSGID(CPF0000)
OVRDBF FILE(WO) TOFILE(*LIBL/WO) SHARE(*YES)
OPNQRYF FILE((WO)) OPTION(*INP) QRYSLT(&QRYSLT)
KEYFLD((WOREC8) (WOID#) (WO#))
CALL PGM(NR014R) PARM(&FROM &TO &OPT &COMM &INIT &STAT
&GRUP &RUSH &SUMO)
CLOF OPNID(WO)
DLTOVR FILE(NR014P WO)

Type of program . . . . . . . . . . . . . . . : ILE
Program entry procedure module . . . . . . . . : NR014R
Activation group attribute . . . . . . . . . . : *DFTACTGRP
Shared activation group . . . . . . . . . . . : *NO

The "F" spec in the RPGLE
FWO IP E DISK


Questions:
A. what's different in your CLP or RPGLE than the above?

B. The OPNQRYF F1 Help includes these 2 stmts - does this match what you
are expecting?

Restrictions:
1. The user can use overrides to change the file, library, and
member names specified for the FILE parameter. Overrides are
ignored for the file and library specified for the FORMAT
parameter, unless FORMAT(*FILE) is specified. Parameter
values specified on an override command, other than TOFILE,
MBR, LVLCHK, WAITRCD, SEQONLY, or INHWRT and SHARE, are
ignored by the OPNQRYF command.
2. The OPNQRYF command does not share an existing open data path
(ODP) in the job or activation group. If an existing
SHARE(*YES) ODP in the job or activation group has the same
file, library, and member name as the open query file open
data path (ODP), the query file does not open and an escape
message is sent.

(Format *FILE is the default, also *INP is open option...)
Open Query File (OPNQR
File specifications:
File . . . . . . . . . . . . . > WO
Library . . . . . . . . . . *LIBL
Member . . . . . . . . . . . . *FIRST
Record format . . . . . . . . *ONLY
Open options . . . . . . . . . . > *INP
Format specifications:
File . . . . . . . . . . . . . *FILE
Library . . . . . . . . . .
Record format . . . . . . . .

C. This stmt not helping us understand what your code is doing - The
necessary overrides are all done appropriately before the source code is
generated and compiled.

IBM docs for reference
https://www.ibm.com/docs/en/i/7.3?topic=file-using-open-query-opnqryf-command

Jim Franz

On Fri, Jan 17, 2025 at 2:20 PM Sam_L <lennon_s_j@xxxxxxxxxxx> wrote:

Not have seen any code, random thoughts on what I might try in this
situation:
1)Does the created RPG program specify an activation group when compiled?
2) Do you call QTEMP/pgm so that the library list is ignored?
3) Is there another version of the program somewhere else that is
getting called when you are testing?
4) How about looking at the opnqryf files after compilation but before
calling QTEMP/rpg to see if they actually have data, just in case the
compile messes something up.

But to me, it sound like an activation group scope issue.

Sam

Caveat: been a developer on the platform since 1995, never used the
cycle and used opnqryf on when maintaining someone else's work


On 1/17/2025 11:38 AM, tgarvey@xxxxxxxxxx
wrote:
Here are the overrides for the open query files, which are in effect
before the RPGLE program is compiled and executed...
ovrdbf openqryf1 tofile(A123456789) share(*yes) ovrscope(*job)
ovrdbf openqryf2 tofile(F123456789) share(*yes) ovrscope(*job)

I am moving to a Power7 server using v7r3 to see of there is any
difference in function...


--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.