|
Kerwin Crawford wrote: >I want to get data from two DDM files with an OPNQRYF >(use OPNQRYF to join them) and use an RPG program >to manipulate the data then populate other files. > >CLP - CS91001C > OVRDBF FILE(CS91001WF1) OVRSCOPE(*JOB) SHARE(*YES) > OVRDBF FILE(SODATAN) OVRSCOPE(*JOB) SHARE(*YES) > OVRDBF FILE(SOMAST) OVRSCOPE(*JOB) SHARE(*YES) >/* RUN QUERY ---------------------------------------------------- */ > OPNQRYF FILE((*LIBL/SODATAN *FIRST SODATACN) + > (*LIBL/SOMAST *FIRST SOMASTCB)) + > FORMAT(&LIB2/CS91001WF1 CS91001WFR) + >/* CALL PROGRAM TO PROCESS THE INFORMATION ---------------------- */ > CALL PGM(&LIB/CS91001R) > >RPG - CS91001R >Fcs91001wf2IF E DISK You have two issues. One is that the RPG program is opening CS91001WF2 and your OPNQRYF is formatting data to look like CS91001WF1. The other is that there's no override for the RPG program's file. I suspect that you need to change the CL to refer to ...WF2. You need an override from CS91001WF2 to the file being opened in your OPNQRYF, which is SODATAN. This way, when the RPG program tries to open CS91001WF2, it will actually open the access path created by OPNQRYF. OVRDBF CS91001WF2 SODATAN OPNSCOPE(*JOB) SHARE(*YES) This works because the "SODATAN" created by OPNQRYF is formatted to look like CS91001WF2 in the FORMAT keyword. Buck Calabro Aptis; Albany, NY +--- | 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.