|
If you had read my last
two post you know that I have been working with an OPNQRYF problem. I
finally got some dedicated time tonight to work on this problem Here is
what I got.
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.
What I have done. I could not get this to work so to copied a subset
of data from each DDM file and restored them to the local system. I then
tried it with these new non-DDM files. It did not work. Then I added
the CPYFRMQRYF command and changed the RPG to get data from this
file. It worked!!! All fine and dandy but you can not do a
CPYFRMQRYF on a DDM file, therefore when I go back to a DDM it won't
work.
The following code of the CLP and RPG represents the programs as they are
now (not DDM). Any suggestions on how to make the DDM work? I am
about 99% sure it is in my file overrides. I feel that my RPG is not
seeing the OPNQRYF file. From what I see I could be able to have my
"F-spec" use the OPNID file name. Is that true?
I appreciate any help. If nothing else thanks for reading this
far.
----------------------------------------------------------------------------------------
CLP - CS91001C
<<snip snip>>
OVRDBF FILE(CS91001WF1) OVRSCOPE(*JOB)
SHARE(*YES)
OVRDBF FILE(SODATAN) OVRSCOPE(*JOB) SHARE(*YES) OVRDBF FILE(SOMAST) OVRSCOPE(*JOB) SHARE(*YES) /* CREATE QUERY SELECTON
---------------------------------------- */
CHGVAR VAR(&SLTCMD) VALUE('CUSNO2 *EQ ' || &S1CST# + || ' *AND QTYSH1 *NE 0 *AND INVDT2 *GE ' + || &FROMDTA || ' *AND INVDT2 *LE ' || &TODTA) /* RUN QUERY ---------------------------------------------------- */ OPNQRYF FILE((*LIBL/SODATAN *FIRST SODATACN) + (*LIBL/SOMAST *FIRST SOMASTCB)) + FORMAT(&LIB2/CS91001WF1 CS91001WFR) + QRYSLT(&SLTCMD) KEYFLD((CUSNO2 *ASCEND) + (INVDT2 *ASCEND)) JFLD((SODATAN/ORDNO + SOMAST/ORDNO *EQ) (SODATAN/HSTSQ +
SOMAST/HSTSQ)) MAPFLD((INVNR2 '2/INVNR')
+
(ITNBR1 '1/ITNBR') (HOUSE1 '1/HOUSE') + (CUSPO2 '2/CUSPO') (ORDNO1 '1/ORDNO') + (COQTY1 '1/COQTY') (QTYBO1 '1/QTYBO') + (QTYSH1 '1/QTYSH') (ISLPR1 '1/ISLPR') + (INSAM1 '1/INSAM') (INVDT2 '2/INVDT') + (SHPNO2 '2/SHPNO') (CUSNO2 '2/CUSNO')) + OPNID(CS91001WF1)
CPYFRMQRYF FROMOPNID(CS91001WF1)
+
TOFILE(TMMODOP997/CS91001WF2) + MBROPT(*REPLACE) CRTFILE(*YES) /* CALL PROGRAM TO PROCESS THE INFORMATION
----------------------
*/
CALL PGM(&LIB/CS91001R) <<snip snip>> ----------------------------------------------------------------------------------------
RPG -
CS91001R
Fcs91001wf2IF
E
DISK
<<snip snip>>
c
read
cs91001wfr
11 eof
c if *in11 = *on <<snip snip>>
----------------------------------------------------------------------------------------
TIA
Kerwin S. Crawford System Analyst Toastmaster Inc. A subsidiary of Salton, Inc. |
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.