× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Kerwin,
 
Try using the CPYFRMQRYF (Copy-From-Query-File) command to verify that your query is working properly...
 
Then if that works, then your over-rides must be wrong....
 
I don't think you should have "K" in the F-spec. Remove the "K" on the queried file...
 
I hope this might help a little bit, I came into this late....
 

Kenneth A. Killian,
Connections 2000, www.conn2000.com
IBM Certified AS400 RPG Programmer/Analyst

-----Original Message-----
From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On Behalf Of Kerwin Crawford
Sent: Friday, April 28, 2000 9:12 AM
To: RPG400-L@midrange.com
Subject: Re: opnqryf Question/Problem again

I appreciate all the help so far.  I have been working on this off and on, and still can not get it to work.  I have made the changes suggested.
 
1. Override to the OPNID(CS910011) with share(*yes) overscope(*job)
2. Make the F-spec match the OPNID
3. Put the K in the F-spec
 
I run a query on the remote system (with same selection) and get records.
 
How do I test if I have records?  I have tried the CPYFRMQRYF command, it won't work due to DDM.
 
The opnqryf runs with out errors.  I have verified the qryslt parm, looks good.  I put the RPG in debug.  The program reads the file and sets on EOF on first read (therefore I do not have any records) and ends the program.
 
Any more thoughts would be appreciated.
 
TIA

Kerwin S. Crawford
System Analyst
Toastmaster Inc.
A subsidiary of Salton, Inc.
-----Original Message-----
From: Kerwin Crawford <crawfork@toastmaster.com>
To: RPG400-L@midrange.com <RPG400-L@midrange.com>
Date: Wednesday, April 26, 2000 6:13 PM
Subject: opnqryf Question/Problem

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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.