Where allowed to run: All environments (*ALL) Threadsafe: Conditional |
Parameters Examples Error messages |
The Submit Remote Command (SBMRMTCMD) command sends a CL command through Distributed Data Management (DDM) to be run on the target system specified by a DDM file. The DDM file determines the communications line used, and indirectly identifies the target system that receives the submitted command.
This command sends only CL commands to a remote system which supports the SBMRMTCMD command language. It cannot send non-CL commands to a different system type (for example, OCL commands cannot be sent to a target System/36).
The primary purpose of this command is to allow a source system user or program to perform file management operations and file authorization activities on files located on a target system.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
CMD | Command to run | Character value | Required, Positional 1 |
DDMFILE | DDM file | Qualified object name | Required, Positional 2 |
Qualifier 1: DDM file | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB |
Top |
Specifies a character string of up to 2000 characters that represents a command that is run on the target system. The command must be allowed in both batch and interactive environments on the target system. The command must be enclosed in apostrophes if it contains embedded blanks or special characters. The command must use the syntax of the target system.
This is a required parameter.
Note: The normal rule of pairing apostrophes in quoted strings on the local system must be doubled when the same string is submitted to a remote system. This is required to allow coding a quoted string within another quoted string.
Top |
Specifies the name and library of the Distributed Data Management (DDM) file that is used to submit the command to the target system. The DDM file is used only to determine the remote location representing the target system. The remote file name associated with the DDM file is ignored by this command.
This is a required parameter.
The possible library values are:
Top |
Example 1: Deleting a File
SBMRMTCMD CMD('DLTF LIBX/FRED') DDMFILE(DENVER)
This command deletes the file named FRED in library LIBX on the target system that is associated with the DDM file named DENVER.
Example 2: Creating a Physical File
SBMRMTCMD CMD('CRTPF SALES/CAR QGPL/QDDSSRC MASTER') DDMFILE(DENVER)
This command creates the physical file CAR in library SALES using the data description specifications (DDS) in the source file QDDSSRC and source member named MASTER in the QGPL library. The DDS must already exist on the target system identified by the DDM file named DENVER in the target job's library list.
Example 3: Changing the Text Description
SBMRMTCMD CMD('CHGDDMF FILE(LIBX/STANLEY) TEXT(''Don''''t forget to pair apostrophes.'')') DDMFILE(SMITH)
This command changes the text in the description of the DDM file named STANLEY which is stored in library LIBX. Because the submitted command requires an outside set of single apostrophes (for the CMD parameter), each single or double apostrophe normally required in the TEXT parameter for local system processing must be doubled for remote system processing. The coding above produces a single apostrophe in the text when it is shown or printed on the remote system.
Example 4: Creating a DDM File
SBMRMTCMD CMD('CRTDDMF FILE(SALES/MONTHLY) RMTFILE(*NONSTD ''CAR.SALES(JULY)'' RMTLOCNAME(DALLAS)') DDMFILE(CHICAGO)
This command creates (on the target system identified by the information in the DDM file named CHICAGO) another DDM file named MONTHLY. The new DDM file is stored in a library named SALES on the CHICAGO system. The new DDM file on the CHICAGO system is used to access a file and member on a different system named DALLAS. The accessed file is named SALES/CAR and the member name in the file is JULY.
Note that this CRTDDMF command string contains three sets of single apostrophes: one set to enclose the entire command being submitted, and a double set to enclose the file and member named in the RMTFILE parameter. This is how any i5/OS file member name must be specified on the SBMRMTCMD command, because of the parentheses needed to enclose the member name.
Example 5: Replacing a Portion of the Library List
SBMRMTCMD CMD('RPLLIBL LIBL(QGPL QTEMP SALES EVANS)') DDMFILE(EVANS)
This command replaces the user's portion of the library list being used by the target job associated with the DDM file named EVANS, which is being used by the source job in which this SBMRMTCMD command is being submitted. In that source job, if there are other open DDM files that specify the same device and mode, this library list is used for them also.
Top |
*ESCAPE Messages
Top |