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



I'm wondering if when you call the procedure to do the OVRDBF if that is one 
level deeper and setting an override there.  Then you step backward into your 
Program 1 and lose the override?  Did I word that right?

I'll have to look at an OPNQRYF program I have.  A lot of people on this and 
another forum helped me understand it all when I had a similar problem.


-----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
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo.cgi/rpg400-l
or email: RPG400-L-request@midrange.com
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-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.