× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



...talking about shared opens (i.e. OPNQRYF)

I had an issue with OPNQRYF long ago, and Scott made me recall it.  That is,
the overrides by default percolate from OPM to ILE NAG, but shared opens do
not.  While that seems desirable at first blush, look at the default value
for OPNQRYF: OPNSCOPE(*ACTGRPDFN).  This is exactly the same default as
OVRDBF, and has virtually the same help text wording.  Given that, I would
expect the OPEN to follow the same scoping rules as the override.

Here is some code that demonstrates this.  It uses the previously posted RPG
code.
(CL is OPM, RPG is in AG QILE)

This reads the wrong member:
 pgm (&file &lib &mbr)
 dcl &file *char 10
 dcl &lib  *char 10
 dcl &mbr  *char 10

 dcl &slt  *char 512
 chgvar &slt 'SRCSEQ *LT 7'

 ovrdbf QRPGLESRC share(*yes)
 opnqryf ((&lib/QRPGLESRC &mbr)) qryslt(&slt)
 call ag01a
 clof qrpglesrc

 endpgm

This reads the wrong member:
 ovrdbf QRPGLESRC share(*yes) opnscope(*actgrpdfn)
 opnqryf ((&lib/QRPGLESRC &mbr)) qryslt(&slt)
 call ag01a

This reads the wrong member:
 ovrdbf QRPGLESRC share(*yes)
 opnqryf ((&lib/QRPGLESRC &mbr)) qryslt(&slt) opnscope(*actgrpdfn)
 call ag01a

This reads the right member and does the selection:
 ovrdbf QRPGLESRC share(*yes)
 opnqryf ((&lib/QRPGLESRC &mbr)) qryslt(&slt) opnscope(*job)
 call ag01a

This reads the right member and does the selection:
 ovrdbf QRPGLESRC share(*yes) opnscope(*job)
 opnqryf ((&lib/QRPGLESRC &mbr)) qryslt(&slt)
 call ag01a

It would appear that only by specifying OPNSCOPE(*JOB) will the open get
shared between AG's, despite the wording of the help text for *ACTGRPDFN.
Did I misunderstand how this is supposed to work?

Manual reference: CL Programming
http://publib.boulder.ibm.com/pubs/html/as400/v5r1/ic2924/info/cl/opnqryf.ht
m
  --buck


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.