An alternative to using QCMDEXEC.
A common way to run CL commands from within an RPG program is to use the QCMDEXEC api. However there is an alternative method using the C library functions.
This example uses the C library function system() to run a CL command to clear a file.
*Run a cl command from RPG
*Use C Library function rather than QCMDEXEC
H bnddir('QC2LE') dftactgrp(*no)
D system PR 10i 0 ExtProc('system')
D string * value
D options(*string)
/free
system('clrpfm dkpm002bf1');
*inlr = *on;
return;