|
THE RPGIV LIBRARY |
|
H nomain
H option(*noshowcpy:*noexpdds:*noext:*noxref)
* NOTE: Create as service program with activation group of *CALLER.
* This ensures commands with activation group scope (such as OVRDBF)
* are effective.
************************************************************************
* PROTOTYPES
************************************************************************
/COPY QCPYSRC,ExecCmd
D QCAPCMD PR extpgm('QCAPCMD')
D CmdString 32767A const options(*varsize)
D CmdLength 10I 0 const
D OptCtlBlk 20A const
D OCBLen 10I 0 const
D OCBFmt 8A const
D ChgCmdStr 1A
D LenAvailCS 10I 0 const
D LenOfChgCS 10I 0
D ErrorCode 144A
*****************************************************************
* EXPORTED PROCEDURES
*****************************************************************
P ExecCmd B export
D ExecCmd PI 7A
D CmdString 32767A value varying
D OptParms 128A options(*NOPASS)
* Locals:
D OCB DS
D TypOfCmdP 10I 0 inz(0)
D DBCS 1A inz('0')
D Prompt 1A inz('2')
D CmdStrSyn 1A inz('0')
D MsgKey 4A inz(*BLANKS)
D Resvd1 9A inz(*LOVAL)
D OCBFmt S 8A inz('CPOP0100')
D CCS S 1A inz(*BLANKS)
D CCSLenAvl S 10I 0 inz(0)
D CCSLenRet S 10I 0 inz(0)
D ErrorDS DS
D Err_BytProv 10I 0
D Err_BytAvail 10I 0
D Err_ExcID 7A
D Err_Rsvd 1A
D Err_Exception 128A
C clear ErrorDS
C eval Err_BytProv=%size(ErrorDS)
C callp QCAPCMD(CmdString
C :%len(CmdString)
C :OCB:%size(OCB):OCBFmt
C :CCS:CCSLenAvl:CCSLenRet
C :ErrorDS)
C if %parms > 1
C eval OptParms = Err_Exception
C endif
C return Err_ExcID
P E
*****************************************************************