Check Command Syntax (QCMDCHK) API
Required Parameter Group:
1 | Command string | I/O | Char(*) |
2 | Length of command string | Input | Packed(15,5) |
Optional Parameter:
3 | IGC process control | Input | Char(3) |
Default Public Authority: *USE
Threadsafe: Yes.
See Usage Notes for command considerations.
The Check Command Syntax (QCMDCHK) API performs syntax checking for a single command, and optionally prompts for the command. The command is not run. If prompting is requested, the command string is returned to the calling program with the updated values as entered through prompting. The QCMDCHK API can be called from an HLL program.
Typical uses of QCMDCHK are:
- Prompt the user for a command and then store the command for later processing.
- Determine the parameter values specified by the user.
- Log the processed command. First, prompt with the QCMDCHK API, run with the Execute Command (QCMDEXC) API, and then log the processed command.
Notes:
- Command strings in System/38™ syntax can use the QCACHECK API. The QCACHECK API accepts the same parameters as QCMDEXC and QCMDCHK.
- The Process Commands (QCAPCMD) API also provides similar functions.
- If the command to be checked is a proxy command, the QCMDCHK API will resolve to the target command. If the target command is also a proxy, the process repeats until either a non-proxy command is found, or the proxy chain becomes greater than the allowed maximum. Once a non-proxy command is found, the resolved command will replace the proxy command in the command string to be checked. The returned command string will contain the original proxy command name.
- Proxy commands will be resolved before the command exit point QIBM_QCA_CHG_COMMAND is called.
Authorities and Locks
- Any Command
- *USE
Required Parameter Group
- Command string
- I/O;CHAR(*)
The command you want to check is entered as a character string. If the command contains blanks, it must be enclosed in apostrophes. The maximum length of the character string is 32,702 characters; delimiters (the apostrophes enclosing the string) are not counted as part of the string.
- Length of command string
- INPUT;PACKED(15,5)
The length of the command string being passed. If the command string is passed as a quoted string, the command length is exactly the length of the quoted string. If the command string is passed in a variable, the command length is the length of the variable.
Optional Parameter Group
- IGC process control
- INPUT;CHAR(*)
The IGC process control instructs the system to accept double-byte data. The only value supported is IGC. IGC must be entered using all uppercase letters.
Usage Notes
While this API is threadsafe, it should not be used to run a command that is not threadsafe in a job that has multiple threads. Use the Display Command (DSPCMD) command to determine whether a command is threadsafe.
Error Messages
Message ID | Error Message Text |
---|---|
CPF0005 E | Returned command string exceeds variable provided length. |
CPF0006 E | Errors occurred in command. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
xxxnnnn E | Any escape message issued by any command may be returned. The messages listed previously are those issued by this API. Once the API has called the command analyzer, any message issued as an escape message may appear. |
API in existance prior to V1R3
[ Back to top | Program and CL Command APIs | APIs by category ]