×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




You can try an dynamically putting the 'correct' file in OPNQRYF statement
and using a format file in the RPG program instead of a logical file.
You'll have to specify OPTION(*ALL) in your OPNQRYF statement. Here is a
quick example.
I pass a file name to this program. Either our open order file or order
history file (same layout). Oehhstwk is a file with no members or data in
it that has the same layout as the other two.

 *************** Beginning of data ***********************
 pgm parm(&file)
 dcl var(&file) type(*char) len(10)

 ovrdbf file(oehhstwk) tofile(&file) share(*yes)
 opnqryf file(&file) +
          format(oehhstwk) +
          option(*all) +
          keyfld(*file)
 call pgm(oehhstrpg)
 clof opnid(&file)
 dltovr file(&file)
 endpgm

Oehhstwk is read full procedural. That's why the OPTION(*ALL)

 *************** Beginning of data
********************************************
 Foehhstwk  if   e           k Disk
 Fqsysprt   o    f  132        printer oflind(*inof)
 Dx                S              6  0
  /free
    for x = 100000 to 100500;
      chain x oehhstwk;
      if %found(oehhstwk);
         except detail;
      endif;
    endfor;
    *inlr = *on;
  /end-free
 OQSYSPRT   H    1P                        1
 O         OR    OF
 O                                              'hEADING'
 Oqsysprt   E            detail
 O                       ordno

I know that there are no orders in the system that match the key between
100000 and100500. When I pass the name of the open file, I get no output.

There are History orders, If I pass the history file, I get output.

This is a quick dirty example. Hope it helps.

Thanks,

Mark

Mark D. Walter
Senior Programmer/Analyst
CCX, Inc.
mwalter@xxxxxxxxxx
http://www.ccxinc.com


                                                                                
                                                                    
                    "Carel Teijgeler"                                           
                                                                    
                    <coteijgeler@xxxxxx        To:     rpg400-l@xxxxxxxxxxxx    
                                                                    
                    .nl>                       cc:                              
                                                                    
                    Sent by:                   Subject:     Re: Generic Logical 
File                                                                
                    rpg400-l-bounces@xx                                         
                                                                    
                    drange.com                                                  
                                                                    
                                                                                
                                                                    
                                                                                
                                                                    
                    08/14/2003 01:43 PM                                         
                                                                    
                    Please respond to                                           
                                                                    
                    RPG programming on                                          
                                                                    
                    the AS400 / iSeries                                         
                                                                    
                                                                                
                                                                    
                                                                                
                                                                    




A possiblity may be OPNQRYF.

Do an OVRDBF file(&MyFile) SHARE(*YES)
          OPENQRYF QRYF(&MyFile) etc.

I did not test this, but I think it will work.

Regards,
Carel Teijgeler

*********** REPLY SEPARATOR  ***********

On 13-8-03 at 18:39 GRAFCOR@xxxxxxx wrote:

>I have 13 physical files, each one has the same file layout as the other
>one.  Depending on the the period the user selects I need to build an
>logical file over one of the files.  The logical file will be deleted as
>soon as the Cl program ends.   When I issue the create logical file
>command I get an error telling me that the physical files must match the
>file names in the dds for the logical file.  Can I create a generic dds
>for the logical file????
>
>Thanks for your help.
>
>
>
>_______________________________________________
>This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
>To post a message email: RPG400-L@xxxxxxxxxxxx
>To subscribe, unsubscribe, or change list options,
>visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
>or email: RPG400-L-request@xxxxxxxxxxxx
>Before posting, please take a moment to review the archives
>at http://archive.midrange.com/rpg400-l.




_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.






As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2026 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.