You many want to take a quick look at the Display Command Line Window (QUSCMDLN) API documented <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/apis/quscmdln.htm”>here</a>. Using it you should be able to provide a command key (like F=9) to present a command entry line (with many of the features of the line taken care of for you).
<i>I am familiar with QCMD but if I call it I’ll call it as a program.</i>
QCMD won’t be involved in your programming. You won’t call it.
You will, however, call QCAPCMD or QCMDEXC depending in how you want details such as Limited Capabilities users to be handled and others.
In any case, you will call an API to process the command and you will call the API as a program call. That’s how it’s done.
Your best choice is to call the <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/qcmdexc.htm”>Execute Command (QCMDEXC) API</a>.
There are better choices, but QCMDEXC will give you enough for now.
There are a number of alternatives, including QCMD. However, you need to start with what is both easy and common.
As with <a href=”http://itknowledgeexchange.techtarget.com/itanswers/command-line-2″>your earlier question</a>, if you also want all of the features of a “normal command line (for example, retrieving previous commands with <F9>), you will do the programming for those features by yourself. The input field that you define is just an input field. Your programming is what makes it act like a “normal command line”. Calling the API is the only thing that helps make things seem like a “normal command line”, and the only thing the API does is process the command that you pass to it as a parm.