We have a requirement to restrict users to BPCS data by facility (even to
view the data). This level of security is available in a number of programs
(by using authorised Warehouse security, set up in SYS600) but not all of

We are attempting to use OPNQRYF to override files before calling BPCS
programs, e.g. override FSO and FSO logicals with a selection on Facility,
before calling SFC500D1. In principle it sounds easy but after trying it
out, doing analysis and reading IBM Infocenter documentation I can not get
to the bottom of the problem, of why the file opened by OPNQRYF is not
shared for SQL selection, Query and DSPPFM.

Below a CL program to illustrate the problem. The program sets up an
OPNQRYF to only select records from file IIM where ICLAS = '61'. The
program then calls  2 programs to print the contents of IIM, before and
after the OPNQRYF command:

   CALL OPNQRYFR  (ILE RPG program which prints the IIM file)
   CALL OPNQRYFR2 (SQLPRGLE program which DECLARE a cursor for selection
   from IIM, and then prints all records found)



   CLOF       OPNID(IIM)

   Before the overwrite database file and open query file CL commands are
   executed , both OPNQRYFR and OPNQRYFR2 prints all the IIM records.

   After the overwrite database file and open query file CL commands are
   executed , OPNQRYFR only prints records with ICLAS = '61', while
   OPNQRYFR2 prints all the IIM records.

Also, when OPNQRYF is used from the command line (i.e. not within a CLP),
the query command 'RUNQRY *N IIM' and 'DSPPFM IIM' do not take the OPNQRYF
selection into consideration (does not use the ODP for the FSO file opened

Please help!


Gerald Lewis

This thread ...

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

This mailing list archive is Copyright 1997-2020 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].