I'm trying to OVRDBF not OVRPRTF.
I found what I needed tho. Thanks for the other info, I'm sure I'll use that at a later date!
You can, however, execute the OVRDBF command from within an RPG program using the QCMDEXC API. The procedure is straightforward; simply follow these steps:
Declare a compile time array with dimension 80, where each element's length is Char 1.
Declare command and command length variables for QCMDEXC of Char 80 and Packed 15,5.
Move the overriding member name from the temporary variable to the member name's physical position of the array.
Move the array value to the command variable.
Call QCMDEXC.
Figure 1 (below) shows the code to execute the OVRDBF command using QCMDEXC.
Gopal Gora, software analyst, Poorva Consultants, India.
--------------------------------------------------------------------------------
Figure 1: Code to execute the OVRDBF command using QCMDEXC
dmbrnm s 10a // mbrnm is
the variable for overriding member name
* To override the file FILE1234 with member MBRNEW1234 using * API
QCMDEXC
darrct1 s 1a Dim(80) Ctdata Perrcd(80)
//arrctl is the variable for compile-time array.
D Cmd s 80A
D Cmdlen s 15P 5
C Movea mbrnm arrct1(44)
C Movea arrct1 Cmd
C Eval Cmdlen = 80
C CALL 'QCMDEXC'
C Parm Cmd
C Parm Cmdlen
**Ctdata arrct1
44
OVRDBF FILE(FILE1234) TOFILE(FILE1234) MBR(MBROLD1234) OVRSCOPE(*JOB)