|
I am sorry. Now, I made a mistake. I feel the query select statement you are building is not exactly correct. With what you are doing now, you will only get the first criteria(CPMAST *EQ 1234). This is making your selection wrong. Your QRYSLT statement should look like IF COND(&CUST *NE &ZERO) THEN(DO) CHGVAR VAR(&QRYSEL) VALUE(&QRYSEL *BCAT '*AND CPCLOC *EQ' + *CAT &CUSTA) ENDDO Regards, Lydia. > -----Original Message----- > From: Nick_Runnalls@burmahcastrol.com > [SMTP:Nick_Runnalls@burmahcastrol.com] > Sent: Wednesday, September 29, 1999 10:58 PM > To: RPG400-L@midrange.com > Subject: OPNQRYF does not seem to be working > > > > I have the following CL Program > > > > PGM PARM(&CUST &MAST &LANG) > > DCL VAR(&CUST) TYPE(*DEC) LEN(8 0) > DCL VAR(&MAST) TYPE(*DEC) LEN(8 0) > DCL VAR(&CUSTA) TYPE(*CHAR) LEN(8) > DCL VAR(&LANG) TYPE(*CHAR) LEN(3) > DCL VAR(&QRYSEL) TYPE(*CHAR) LEN(128) > DCL VAR(&ZERO) TYPE(*DEC) LEN(8 0) VALUE(0) > > /*------------------------------------------------------------------*/ > /* Generic message monitor */ > /*------------------------------------------------------------------*/ > MONMSG MSGID(CPF0000 RPG0000 MCH0000) > > CHGVAR VAR(&CUSTA) VALUE(&CUST) > > CHGVAR VAR(%SST(&QRYSEL 1 10)) VALUE('CPMAST *EQ') > > CHGVAR VAR(%SST(&QRYSEL 12 8)) VALUE(&MAST) > > IF COND(&CUST *NE &ZERO) THEN(DO) > CHGVAR VAR(&QRYSEL) VALUE(&QRYSEL *CAT 'CPCLOC *EQ + > ' *CAT &CUSTA) > ENDDO > > OVRDBF LABCMPL1 SHARE(*YES) > > OPNQRYF FILE((LABCMPL1)) OPTION(*INP) + > QRYSLT(&QRYSEL) KEYFLD(*FILE) > /* CPYFRMQRYF FROMOPNID(LABCMPL1) TOFILE(QTEMP/LABCMP) + > CRTFILE(*YES) */ > > CHGVAR VAR(%SST(&QRYSEL 1 10)) VALUE('SAMAST *EQ') > CHGVAR VAR(%SST(&QRYSEL 12 8)) VALUE(&MAST) > > > IF COND(&CUST *NE &ZERO) THEN(DO) > CHGVAR VAR(&QRYSEL) VALUE(&QRYSEL *CAT ' SACUST *EQ + > > ' *CAT &CUSTA) > ENDDO > > > OVRDBF LABMASL6 SHARE(*YES) > OPNQRYF FILE((LABMASL6)) OPTION(*INP) + > QRYSLT(&QRYSEL) KEYFLD((SAMAST) (SAUNIT) + > (SACOMT) (SALOCN) (SASAMP *DESCEND)) + > UNIQUEKEY(4) > /* CPYFRMQRYF FROMOPNID(LABMASL6) TOFILE(QTEMP/LABMAS) + > CRTFILE(*YES) */ > > /*------------------------------------------------------------------*/ > /* Call Print */ > /*------------------------------------------------------------------*/ > > CALL PGM(LBK0UPR) PARM(&CUST &MAST &LANG) > > > DLTOVR FILE(*ALL) > > CLOF OPNID(LABCMPL1) > CLOF OPNID(LABMASL6) > > ENDPGM > > > It is selecting no records in the RPG IV program (LBK0UPR). > > If the commented out CPYFRMQRYF statements are run the data is selected > correctly in those files. Ihave tried using POSDBF > > It does not help. > > > > I have been through the archives and others are hinting at these problems. > The access paths were already shared open and i have tried removing the > OVRDBF commands none of it seems to make a diffrence. Am I going Mad. I > have used OPNQRYF much in the past, but with RPG III or 400 whatever > > > > Anyone solved this > > > +--- > | 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 > +--- +--- | 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.