|
Andy, Your opnqryf is opening two files but you are only closing one. Try adding a clof on the second file and see if that helps. Scott Mildenberger > -----Original Message----- > From: ajeffery@bacardi.com [mailto:ajeffery@bacardi.com] > Sent: Tuesday, May 08, 2001 8:22 AM > To: RPG400-L@midrange.com > Subject: Re: OPNQRYF - ODP Error > > > > This program is called Multiple times (multi company > environment) within a > single run but the file is closed at the end of this pgm. > I'm probably > missing something obvious! > > > > > bill.reger@convergys.com@midrange.com on 08/05/2001 14:32:59 > > Please respond to RPG400-L@midrange.com > > Sent by: owner-rpg400-l@midrange.com > > > To: RPG400-L@midrange.com > cc: > Subject: Re: OPNQRYF - ODP Error > > > > It sounds as if the file is already opened from (probably) a previous > OPNQRYF. You should issue a CLOF after you're finished with an open. > > > > > > ajeffery@bacardi.com@midrange.com on 05/08/2001 08:19:04 AM > > Please respond to RPG400-L@midrange.com > > Sent by: owner-rpg400-l@midrange.com > > > To: RPG400-L@midrange.com > cc: > Subject: OPNQRYF - ODP Error > > > I'm receiving the following error within an OPNQRYF command. > > CPF4205 - Shared Open not allowed for query. > > I have tested the program in a Test environment without any problems > whatsoever however the > above error occurs as soon as the program is processed in the Live > environment, any ideas? > > > /** Set-up Override For Open Query File **/ > OVRDBF FILE(WHP3530) TOFILE(*LIBL/WHP35) SECURE(*YES) SHARE(*YES) > > /** Find Available Active Stock Within the Primary & > Secondary Areas ** > CHGVAR VAR(&SEL) VALUE('(CONO35 *EQ "' || &L#CONO || '") *AND + > (STRC35 *EQ "' || &A#STRC || '") *AND + > (PNUM35 *EQ "' || &W#PNUM || '") *AND + > (SAVL35 *GT 0) *AND + > (STAT30 *EQ "1") *AND + > (AREA30 *EQ "' || &W#PARA || '") + > *OR + > (CONO35 *EQ "' || &L#CONO || '") *AND + > (STRC35 *EQ "' || &A#STRC || '") *AND + > (PNUM35 *EQ "' || &W#PNUM || '") *AND + > (SAVL35 *GT 0) *AND + > (STAT30 *EQ "1") *AND + > (AREA30 *EQ "' || &W#SARA || '")') > > /** Determine Area Sequencing **/ > IF COND(&W#PARA *GE &W#SARA) THEN(DO) > > /** Process Query By Descending Area **/ > OPNQRYF FILE((*LIBL/WHP35) (*LIBL/WHP30)) + > FORMAT(*LIBL/WHP3530) QRYSLT(&SEL) + > KEYFLD((WHP35/CONO35) + > (WHP35/STRC35) + > (WHP35/PNUM35) + > (WHP35/DTRT35) + > (WHP30/AREA30 *DESCEND) + > (WHP35/LOCN35)) + > JFLD((WHP35/CONO35 WHP30/CONO30) + > (WHP35/STRC35 WHP30/STRC30) + > (WHP35/LOCN35 WHP30/LOCN30)) + > SEQONLY(*NO) > ENDDO > > ELSE CMD(DO) > > /** Process Query By Ascending Area **/ > OPNQRYF FILE((*LIBL/WHP35) (*LIBL/WHP30)) + > FORMAT(*LIBL/WHP3530) QRYSLT(&SEL) + > KEYFLD((WHP35/CONO35) + > (WHP35/STRC35) + > (WHP35/PNUM35) + > (WHP35/DTRT35) + > (WHP30/AREA30 *ASCEND) + > (WHP35/LOCN35)) + > JFLD((WHP35/CONO35 WHP30/CONO30) + > (WHP35/STRC35 WHP30/STRC30) + > (WHP35/LOCN35 WHP30/LOCN30)) + > SEQONLY(*NO) > ENDDO > > CALL PGM(WWH495) > > > CLOF OPNID(WHP35) > DLTOVR FILE(WHP3530) > RETURN > > Thanks in advance > Andy J > > +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-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 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.