DEFSCMD
Note: This is an authorized command.
>>-DEFSCMD -+-etarget--ecmdnm-+--+-itarget--icmdnm-+------------> +-etarget--*------+ +-itarget--*------+ '-*--*------------' '-=--=------------' >--+-pgmname------+--(--+-CICSLINK +--+------+----------------->< +-CICS_loadmod-+ +-CICSLOAD + '-AUTH ' +-execname-----+ '-REXX ----' '-(--CLEAR-----'
DEFSCMD defines (or redefines) REXX system commands.
Operands
- etarget
- is the name of the external target environment you used in a REXX
exec issuing this command. This is the external environment name that
you directed the command string to. This environment name is looked
up in a table and together with the command name determines which
program, REXX exec, or queue this command string is directed to for
processing. Note: The external target can match the environment name on the ADDRESS keyword instruction or can be specified as the first token of the command string, if REXXCICS is the current environment (which is the default).
- ecmdnm
- is the first command name token that you used issuing this command. This is the first word of the command name as it is known to you. If a special value of asterisk (*) is specified (as part of this definition), then all commands that you issued with an environment name of etarget and that are not more explicitly defined elsewhere, are covered by this command definition.
- itarget
- specifies an internal environment name that this command definition passes to the agent that processes the command string. This is needed so that the external environment names known to you can be redefined without breakage of the agents that process these commands. If the internal and external names are identical, then there is no need for you to specify the internal name. A special value of "=" indicates that itarget is the same as etarget.
- icmdnm
- is the first word of the internal command name. This is the first part of the command name that is passed to the REXX command agent to specify what command is processed. This is specified only if it is different from ecmdnm. A special value of "=" indicates that icmdnm is the same as ecmdnm.
- pgmname
- specifies the CICS program that is called by an EXEC CICS LINK to process the command.
- CICS_loadmod
- specifies the name of the CICS program called because the CICSLOAD
option was specified. Note: The program is only loaded on the first instance of a command and its address is remembered for subsequent commands.
- execname
- specifies the exec called as a REXX command server processing this command (or commands). If this server exec is already running then this command is routed to the executing server. If a REXX server by this name is not running, then Automatic Server Initiation (ASI) is used to start the server automatically. The execname can be either a file name (where the file type defaults to EXEC) or it can be in the form filename.filetype.
- CICSLINK
- is a keyword indicating that the processing agent for the defined REXX command is a standard CICS program that is called by an EXEC CICS LINK.
- CICSLOAD
- is a keyword indicating that the processing agent is a CICS program that is loaded by an EXEC CICSLOAD.
- REXX
- is a keyword indicating that the processing agent for this REXX command is a REXX exec that operates as a command server.
- AUTH
- is a keyword indicating that this is an authorized REXX/CICS command. It is a command that can only be executed by an authorized REXX/CICS user (specified on AUTHUSER command) or from within an exec loaded from an authorized library.
- CLEAR
- is a keyword indicating that the purpose of this DEFSCMD is to clear any previous definitions for the specified external target environment and command names.
Return codes
- 0
- Normal return
- 1101
- Invalid command
- 1121
- Cannot load program
- 1123
- Entry not found
- 1148
- No client available
- 1199
- Internal error
Example
'DEFSCMD CICS SEND = = SENDPGM (CICSLINK'
This
example defines a command called SEND for this user only. The user
can issue this command, under the default command environment of REXXCICS,
by entering:
'CICS SEND arg1 arg2 ... argn'
This
example shows program SENDPGM being called by an EXEC CICS LINK command
to process this command.Notes
- When the REXX/CICS environment name is REXXCICS (which is the default when all execs or macros are called), then the first token of the command string is the environment name that could have been used with an ADDRESS environment REXX instruction. This provides a more integrated command environment and removes the need for constant environment switching by ADDRESS instructions.
- The calling and parameter passing sequences for command programs receiving control by an EXEC CICS LINK and an Assembler BASSM instruction (the CICSLOAD option) are similar. Refer to REXX/CICS Command Definition for more information on writing command programs.
- If the first two operands of DEFSCMD are all asterisks (* *) then this is a catch-all definition that specifies a command processing agent issued for REXX commands that are not under the scope (do not match) of any more specific command definitions.
- User command definitions are searched before system command definitions (except for DEFSCMD, which cannot be overridden).
- REXX commands can be written in REXX. These REXX commands in turn call other REXX commands which are written in REXX, in a building block fashion. Since DEFSCMD hides the implementation detail from the REXX user (programmer), a command can be quickly written in REXX and later transparently rewritten in another language, if it becomes performance critical.
