| 
 | 
| I have a problem with a opnqryf. I have two files that I am joining and selecting 
data from them.  These two files are DDM files.  I am then calling a 
RPGLE program to process the selected information.  My RPG is not finding 
any records.  I should have several.  I am wondering if I am using the 
correct file name in the F spec., or what?  The following is some excerpt 
of the code. ---------------------------------------------------------------------------------------- CLP  -  CS91001C   <<snip snip>> /* 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(CS910011) /* CALL PROGRAM TO PROCESS THE INFORMATION ---------------------- */ CALL PGM(&LIB/CS91001R) <<snip snip>> ---------------------------------------------------------------------------------------- RPG   -  
CS91001R                                                             
 Fcs91001wf1IF   
E             
DISK           <<snip snip>> c                   
read      
cs91001wfr                             
11    eof  
 c if *in11 = *on   <<snip snip>> ---------------------------------------------------------------------------------------- PF  -  CS91001WF1 A          R 
CS91001WFR                                                   
 A INVNR2 6S 0 COLHDG('INVOICE' 'REF' 'NUMBER') A ITNBR1 15A COLHDG('ITEM' 'NUMBER') A HOUSE1 3A COLHDG('WAREHOUSE') A CUSPO2 22A COLHDG('PURCHASE' 'ORDER' 'NUMBER') A ORDNO1 7A COLHDG('ORDER' 'NUMBER') A COQTY1 10S 3 COLHDG('CUSTOMER' 'ORDER' 'QTY') A QTYBO1 10S 3 COLHDG('BACKORDERED' 'QUANTITY') A QTYSH1 10S 3 COLHDG('QUANTITY' 'SHIPPED') A ISLPR1 15S 3 COLHDG('SELLING' 'PRICE') A INSAM1 13S 2 COLHDG('NET' 'SALES' 'AMOUNT') A INVDT2 7S 0 COLHDG('INVOICE' 'DATE') A SHPNO2 4A COLHDG('SHIP-TO' 'NUMBER') A CUSNO2 8S 0 COLHDG('CUSTOMER' 'NUMBER') ---------------------------------------------------------------------------------------- With the time that I have spent trying to figur 
this out I could have rewote the program not to use the opnqryf comand, but I 
must know what is wrong. 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-2025 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.