I'd be happy too. However you might want to consider breaking it down
into your own prototypes and/or subprocedures. The reason being is that
it has a LOT of parameters and for simple command execution it may look
cumbersome to handle all the parameters. It can also do stuff like prompt
a user for a command, have them enter more options, then your application
can store the final command into a file for your menuing system, etc.
/if not defined(QCAPCMD)
* Process Commands
D qcapcmd PR EXTPGM('QCAPCMD')
* replacement for QCMDEXC. See 'OS/400 Program and CL Command APIs'
D SourceCmd 32702a const options(*varsize)
D SourceCmdLen 10i 0 const
D OptCtlBlck like(CPOP0100)
D const options(*varsize)
D OptCtlBlckLen 10i 0 const
D OptCtlBlckFmt 8a const
D ChgCmd 32702a options(*varsize:*omit)
D ChgCmdLenAv 10i 0 const
D ChgCmdLenRet 10i 0 options(*omit)
D ErrorCode 32767a options(*varsize)
/if not defined(ERRC0100)
* ERRC0100 - Error code data structure
D ERRC0100 DS
D BytesProvided 10I 0 INZ(%len(errc0100))
D BytesAvail 10I 0
D ExceptionId 7A
D Reserved1 1A
D ExceptData 250A
D ERRC0100P S LIKE(ERRC0100)
/if not defined(CPOP0100)
* Format CPOP0100 for Process Command (QCAPCMD) API. QCAPCMD is a
* better alternative for QCMDEXC.
D CPOP0100 DS qualified
D cpType 10I 0 inz(0)
* 0=Command running. Like QCMDEXC.
* 1=Command syntax check. Like QCMDCHK.
* 2=Command line running. Will prompt for missing required
* 3=Command line syntax check. Like QCMDCHK but with check
* only complement of option 2.
* 4=CL program statement. Edits the command like SEU would.
* 5=CL input stream. Checked according to rules for CL
* batch jobs, (CL, not CLP).
* 6=Command definition statements. Syntax is checked for
* statements used to make *CMD objects.
* 7=Binder definition statements are syntax checked.
* 8=User-defined option. See the manual.
* 9=ILE CL program source. Syntax is checked as if it
* were for a CLLE program.
* 10=Command prompt string. Prepares command for prompting.
D DBCSHandling 1A inz('0')
* 0=Ignore DBCS data
* 1=Handle DBCS data
D PrompterAct 1A inz('0')
* 0=Never prompt the command.
* 1=Always prompt the command.
* 2=Prompt the command if selective prompting characters are
* present in the command string.
* 3=Show help.
D CmdSyntax 1A inz('0')
* 0=Use 400 (system) syntax for commands
* 1=Use S/38 syntax for commands
D MsgRtvKey 4A inz(*loval)
* The message retrieve key identifies a request message. If
* prompting is requested, the request message identified by
* the message retrieve key is replaced by the updated
* string. If the message key contains all hexadecimal zeros
* or all blanks, no request message is updated.
D Reserved1 9A inz(*loval)
D CPOP0100P S LIKE(CPOP0100)
This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact