The Submit Remote Command (SBMRMTCMD) command submits a CL command using Distributed Data Management (DDM) support to run on
the target system. You first need to create a DDM file. The remote location information of the DDM file is used to determine the communications line to be used. Thus, it identifies the target system that is to receive the submitted command. The remote file associated with the DDM file is not involved when the DDM file is used for submitting commands to run on the target system. See Setting up DDM files for information on creating DDM files.
The SBMRMTCMD command can submit any CL command that can run in both the batch environment and via the QCAEXEC system program; that is, the command has values of *BPGM and *EXEC specified for the ALLOW attribute. You can display the ALLOW attributes by using the Display Command (DSPCMD) command.
The primary purpose of the SBMRMTCMD command
is to allow a source system user or program to perform file management operations and file authorization activities on objects located on a target system. A secondary purpose of this command is to allow a user to perform nonfile operations (such as creating a message queue) or to submit user-written commands to run on the target system. The CMD parameter allows you to specify a character string of up to 2000 characters that represents a command to be run on the target system.
You must have the proper authority on the target system for the CL command being submitted and for the objects that the command is to operate on. If the source system user has the correct authority to do so (as determined in a target system user profile), the following actions are examples of what can be performed on remote files using the SBMRMTCMD command:
Although the command can be used to do many things with tables or other objects on the remote system, using this command for some tasks is not as efficient as other methods on the AS/400 system. For example, you could use this command to display the file descriptions or field attributes of remote files, or to dump files or other objects, but the output remains at the target system. To display remote file descriptions and field attributes at the source system, a better method is to use the Display File Description (DSPFD) and Display File Field Description (DSPFFD) commands with SYSTEM(*RMT) specified, and specify the names of the DDM files associated with the remote files.
See the Distributed Data Management book for lists of CL commands you can submit and restrictions for the use of this command. In addition, see Controlling DDM conversations for information about how DDM shares conversations.
You can use the SBMRMTCMD command to grant temporary
authority to an object. For example, a programmer on one system would like to call a program on another system and watch its operation for debugging purposes. The distributed relational database administrator could get authority to the program to be checked for the local programmer by entering the following command:
SBMRMTCMD CMD('GRTOBJAUT OBJ(SPIFFY/PARTS1) OBJTYPE(*PGM)
USER(MPSUP) AUT(*USE)') DDMFILE(TEST/KC105TST)
This submitted command grants *USE authority to the user MPSUP to the object PARTS1. PARTS1 is a program that exists on the system identified by the DDM file named KC105TST on the local system. The authority is granted if the distributed relational database administrator has authority to use the GRTOBJAUT command on the remote system named in the KC105TST DDM file.