Does anyone know how to call a *CMD program in free RPG using a prototype? In my case the command has 10 parameters and I want to call it with just 4.
Calling it with 10/10 parameter works. But how do I do it with fewer parameters?
Commands (*CMD) are executed by the command language processor, not called.
Assuming a user written command, thus you have the source for the program envoked by the command...I'd recommend creating a prototype and calling the program that processes the command directly...
DSPCMD will tell you what that program is...
If an IBM or third party command, you'll need to call the command language processor and pass it the command you want to execute.
IBM provides a few APIs for the command language processor..
Execute Command (QCMDEXC)
Process Commands (QCAPCMD)
Also, you can use the C-runtime API
system() — Execute a Command
Here's a nice article about using the most powerful (and complex) option, QCAPCMD...with links to articles about QCMDEXC and system().
QCAPCMD another alternative to QCMDEXC