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


  • Subject: Re: opnqryf Question/Problem
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Thu, 27 Apr 2000 01:19:01 -0500 (CDT)


Hi Kerwin,

I've got a few suggestions that you can try to get your OPNQRYF working:

1) The filename on your F spec should match the OPNID() parameter on your
     OPNQRYF..  It does not in this example.

2) You need an override that will make your OPNQRYF and your RPG program
     share access paths with one another.   If you dont do this, your
     OPNQRYF can't affect your RPG program.

3) The override must either be scoped to the job, or must be be in the
     same activation group as your RPG program.  

4) You probably need a "K" in your F-spec that denotes that the file is
     to be accessed in keyed sequence.   If you dont include this, the
     OPNQRYF cant affect your RPG program.  


Try adding a line like this:

OVRDBF FILE(CS910011) SHARE(*YES) OVRSCOPE(*JOB)

before the OPNQRYF.

Then change your F-spec to:

     Fcs910011  IF   E           K DISK        

And both programs and see if that works.  

Hope that helps...

        

On Wed, 26 Apr 2000, Kerwin Crawford wrote:

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

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

Follow-Ups:
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.