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



Aaron -

Here's what I've done.  I think I was going to try to do the same as you with 
your procedure, but ran into that same problem with the override at the wrong 
level.  I also ran into a problem of trying to close the file in this program, 
but had to use the QCMDEXC to do it at the correct level.

Hopefully I'm not steering you down the wrong path.



h bnddir( 'QC2LE' )                                                  
h dftactgrp( *no )                                                   
                                                                     
fSUS100AL  uf   e             disk    usropn                         
                                                                     
d @qcmdexc        pr            10i 0 extproc( 'system' )            
d command                         *   value options( *string )       
                                                                     
d cmd             s           3000a                                   
d string          s             80a   dim(2) ctdata perrcd(1) varying 
d today           s               d   inz(*job)                       
d today#          s              8s 0                                 
                                                                      
c                   move      today         today#                    
                                                                      
 /free                                                                

  // OVRDBF                                              
                                                         
  @qcmdexc( 'OVRDBF FILE(SUS100AL) SHARE(*YES)' );       
                                                         
  // OPNQRYF                                             
                                                         
  cmd = string(1) + ' ' + string(2);                     
  cmd = %replace( %editc(today# : '4') : cmd : %scan('########' : cmd) );
  @qcmdexc( cmd );                                                       
                                                                         
  if not %open( SUS100AL );                                              
    open SUS100AL;                                                       
  endif;                                                                 
                                                                         
  // read thru file and flag all records which have been pulled in via   
  // the OPNQRY.                                          
                                                          
  read SUS100AL;                                          
  dow not %eof( SUS100AL );                               
                                                          
    %subst( PA_XT2 : 1 : 1 ) = 'P';                       
    update PA_REC;                                        
                                                          
    read SUS100AL;                                        
  enddo;                                                  
                                                          
  // CLOF and DLTOVR                                      
                                                          
  @qcmdexc( 'CLOF OPNID(SUS100AL)' );                     
  @qcmdexc( 'DLTOVR FILE(*ALL)' );                        
                                                          
  *inlr = *on;                       
                                     
 /end-free                           
                                     
**                                                                 
OPNQRYF FILE((SUS100AL)) OPTION(*ALL) QRYSLT('PA_ERROR = "Y"       
*AND PA_PDATE = ########')                                         

                                     



-----Original Message-----
From: Bartell, Aaron L. (TC) [mailto:ALBartell@taylorcorp.com]
Sent: Friday, January 17, 2003 11:13 AM
To: 'RPG400-L@midrange.com'
Subject: Activation Groups, external sub procedures, and OVRDBF


I have looked in the archives but am unable to find an example similar to
mine, so here I go. . .

I have a situation where my OVRDBF isn't working and from my point of view I
have all of my ducks in a row.  I have PGM1 doing a CALLP to a sub procedure
named clCmdExec which executes the OVRDBF command I send into it.  For
example:

PGM1...
     C                   CallP      cLCmdExec('OVRDBF FILE(ORDHDR1)
TOFILE(PRODLIB/ORDHDR1)')


cLCmdExec (external module that is bound into PGM1) . . .
     P cLCmdExec...
     P                 B                   Export
     D cLCmdExec...
     D                 PI              N
     D  pCmd                       1024    Value Varying
     D  pLength                      15  5 Value Options(*NoPass)
     C                   If         %Parms = 1
     C                   Eval       pLength = %Len(%Trim(pCmd))
     C                   EndIf

     C                   Call      'QCMDEXC'                            99
     C                   Parm                    pCmd
     C                   Parm                    pLength

     C                   Return    *In99
     P                 E

I created PGM1 with DFTACTGRP(*NO) ACTGRP(*CALLER).
I created the service pgm cLCmdExec is in with ACTGRP(*CALLER).

The above doesn't override the file; when I open ORDHDR1 it grabs the first
ORDHDR1 in the library list which is in TESTLIB.  

The override _does_ work if I have the following in PGM1 instead of using a
sub procedure.

PGM1...
     C                   Eval      pCmd = 'OVRDBF FILE(ORDHDR1)
TOFILE(PRODLIB/ORDHDR1)'                             
     C                   Call      'QCMDEXC'                            99
     C                   Parm                    pCmd
     C                   Parm                    pLength

Could someone tell me how I might be compiling my programs wrong? or how I
might be using the OVRDBF wrong?  I have tried changing the override scope
on OVRDBF, but that didn't fix my problem.

Aaron Bartell


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