Return to the RPG Tips
Prototype the OVRDBF or any command to be called via QCMDEXC method.
Define Prototype for ILE call to QCMDEXC. Of course if you don't want to get into ILE programming, you can just define the CMD fields and use the OPM CALL 'QCMDEXC' with PARM opcodes. e.g. d Qcmdexc pr Extpgm('QCMDEXC') d Cmd Like(Qcmd) Options(*Varsize) Const d CmdLen 15p 5 Const d CmdOpt 3 Options(*NoPass) Const d Qcmd s 3000 - - Define the command or portions thereof as constants as needed. e.g. *----------------------------------------------------------------------- * * Named Constants *----------------------------------------------------------------------- * d CrtDupP1 c 'CRTDUPOBJ OBJ(' d CrtDupP2 c ') FROMLIB(' d CrtDupP3 c ') OBJTYPE(*FILE) TOLIB(QTEMP)' d OvrPrtf c 'OVRPRTF FILE(QSYSPRT) PAGESIZE(*N 1- d 98) CPI(15) MAXRCDS(*NOMAX) OVRSCOPE- d (*JOB) SHARE(*YES)' - - Assign command to variable e.g. ILE c Eval Qcmd = CrtDupP1 + 'RPSRVCWK1' c + CrtDupP2 + %Trimr(DtaLib) c + CrtDupP3 c CallP(e) Qcmdexc(Qcmd : %Len(%Trim(Qcmd))) c If %Error : c EndIf e.g. RPGLE (OPM) c Eval QcmdLen = %Len(%Trim(Qcmd)) c Call(e) 'QCMDEXC' c Parm Qcmd c Parm QcmdLen I hope this helps you dig in..... As for the conversion of the source to RPGIV, I've encountered a minor problem when an external DS is defined and an array by the same name redefines a sub-field of the DS. I've had to rename the array field throughout the program and define it within the DS using the OVERLAY Keyword. e.g. RPG E DXF 9 2 IPIQ000 E DSIQ000DS DXF is defined in the external DS as; FMT J .....I....................................PFromTo++DField 66956712 DXF RPGLE d Piq000 E Ds Extname(Iq000Ds) d DxfA 2 Dim(9) Overlay(Piq000:6695)
[report a broken link by clicking here]