如何於 RPG 中直接 OVRDBF 及 DLTOVR PF Member ?
File : QRPGLESRC
Member: OVRDBFR
Type : RPGLE
Usage : CRTBNDPGM OVRDBFR
H DEBUG OPTION(*SRCSTMT:*NODEBUGIO) DFTACTGRP(*NO) ACTGRP(*CALLER)
Dmbrnm S 10a
* mbrnm is the variable for overriding member name
* To override the file FILE123456 with member MBRNEW1234 using
* API QCMDEXC
Darrct1 S 1a Dim(80) Ctdata Perrcd(80)
Darrct2 S 80a Dim(1) Ctdata Perrcd(1)
* arrctl is the variable for compile-time array.
D Cmd S 80A
D Cmdlen S 15P 5
* ovrride
C Eval mbrnm = 'MBRNEW1234'
C Movea mbrnm arrct1(48)
C Movea arrct1 Cmd
C Eval Cmdlen = 80
C CALL 'QCMDEXC'
C Parm Cmd
C Parm Cmdlen
*
*
* Process your code here
*
*
C Dump
* delete ovrride
C Reset Cmd
C Movea arrct2 Cmd
C Eval Cmdlen = 80
C CALL 'QCMDEXC'
C Parm Cmd
C Parm Cmdlen
C Eval *InLr = *On
**Ctdata arrct1 48
OVRDBF FILE(FILE123456) TOFILE(FILE123456) MBR(MBROLD1234) OVRSCOPE(*JOB)
**Ctdata arrct2
DLTOVR FILE(FILE123456) LVL(*JOB)
A blog about IBM i (AS/400), MQ and other things developers or Admins need to know.
星期三, 11月 01, 2023
2002-04-08 如何於 RPG 中直接 OVRDBF 及 DLTOVR PF Member ?
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言