Submit Remote Command (SBMRMTCMD)

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.



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

Command to run (CMD)

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.


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:

The library list is used to locate the file.
The current library for the job is used to locate the file. If no library is specified as the current library for the job, the QGPL library is used.
Specify the library where the file is located.


Example 1: Deleting a File


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


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

              TEXT(''Don''''t forget to pair apostrophes.'')')

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

                         RMTFILE(*NONSTD ''CAR.SALES(JULY)''

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


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.

Error messages

*ESCAPE Messages

Target system does not support SBMRMTCMD.
File &1 in library &2 not a DDM File.
Error occurred on distributed file.
Target system &3 not available.
SBMRMTCMD command ended abnormally.
Error on call to user exit program on target system.
Error during processing of user exit program.
User exit program did not complete successfully.
Processing of the command specified by SBMRMTCMD failed.
Cannot start DDM communications.