Note on usage
Function: Execute remote command
User group: FT user
Functional description
With the FTEXEC command, you can execute operating system commands in the remote system. In the local system, the resulting standard and standard error output can be sent to *STDERR, *STDOUT or to a file.
FTEXEC is only available for openFT partners from Fujitsu Technology Solutions.
On success, FTEXEC returns 0 and if an error occurs it returns 12. The result of the command executed is also transferred.
In the case of output to *FILE, it is possible to specify character sets.
In the case of output to *STDOUT, the character set specified in the local system is used.
Format
FTEXEC |
PARTNER = <text 1..200 with-low> ,CMD= *NOT-SPECIFIED / <c-string 1..400 with-low> (...) CODED-CHARACTER-SET = *STD / <alphanum-name 1..8> ,TRANSFER-ADMISSION = *NONE / <alphanum-name 8..32> / <c-string 8..32 with-low> / <x-string 15..64> / *PARAMETERS(...) *PARAMETERS(...) USER-IDENTIFICATION = <name 1..8> / <c-string 1..67 with-low> ,ACCOUNT = *NONE / <c-string 1..64 with-low> / <text 1..64> ,PASSWORD = *NONE / <c-string 1..64 with-low> / <x-string 1..128> / <alphanum-name 1..19> ,OUTPUT = *STDERR / *STDOUT / *FILE(...) *FILE(...) FILE-NAME = <filename 1..59> ,CODED-CHARACTER-SET = *STD / <alphanum-name 1..8> ,DATA-TYPE = *CHAR ACTER / *BINARY ,DATA-ENCRYPTION = *NO / *YES ,FILE-NAME-ENCODING = *TRANSPARENT / *CHARACTER |
Operands
PARTNER = <text 1..200 with-low>
Name of the partner system as defined in the partner list by the FT administrator or the partner system address. For more information on address specifications, see section“Specifying partner addresses”.
CMD =
Command in the syntax of the remote FT partner system. A command sequence in the remote system can only be processed if the remote system is using an FT product that supports this function.
CMD = *NOT-SPECIFIED
No command string is passed. *NOT-SPECIFIED must be used if an admission profile is specified in TRANSFER-ADMISSION for which a command sequence has been preset.
CMD = <c-string 1..400 with-low>
Command sequence. This command sequence may be a maximum of 400 characters in length, with special characters being counted double (as two characters).
CODED-CHARACTER-SET =
Coding (character set) to be used when reading the data from the standard output of the remote command.
CODED-CHARACTER-SET = *STD
The character set defined as standard in the remote system is used.
CODED-CHARACTER-SET = <alphanum-name 1..8>
The specified character set (CCS) is used. This must be known in the remote system. This specification must not be combined with DATA-TYPE=*BIN.
TRANSFER-ADMISSION =
Contains specifications about the transfer admission in the remote system.
TRANSFER-ADMISSION = *NONE
The remote system does not require or does not know any user admissions.
TRANSFER-ADMISSION = <alphanum-name 8..32> / <c-string 8..32 with-low> / <x-string 15..64>
If FTAC functionality is used in the remote system then the transfer admission for the remote system can be defined via an admission profile. In this case, only the TRANSFER-ADMISSION defined in the admission profile is used here. In the case of alphanumeric input, uppercase is converted to lowercase internally.
TRANSFER-ADMISSION = *PARAMETERS(...)
Specifies the user's identification, account number and password in the remote system. The operands in the brackets can also be used as positional operands without the associated keywords.
USER-IDENTIFICATION = <name 1..8> / <c-string 1..67 with-low>
Identification of the user in the remote system. The identification must be specified in the syntax of the remote system and must adhere to the conventions used in the remote system.
ACCOUNT = *NONE / <c-string 1..64 with-low> / <text 1..64>
Account number of the user in the remote system. The account number must be specified in the syntax of the remote system and must adhere to the conventions used in the remote system.
PASSWORD =
Password allowing the user to access the remote system.
PASSWORD = *NONE
Access is possible without a password.
PASSWORD = <c-string 1..64 with-low> / <x-string 1..128> / <alphanum-name 1..19>
Password allowing the user to access the remote system. The password must be specified in the syntax of the remote system, must adhere to the conventions used in the remote system and must be known there.
OUTPUT =
Specifies where the data generated by the command should be output following transfer in the local system.
OUTPUT = *STDERR
The data is written to *STDERR.
OUTPUT = *STDOUT
The data is written to *STDOUT.
OUTPUT = *FILE(...)
The data is written to a file. Please note that only the data which the command specified with CMD outputs to *SYSLST (BS2000) or *STDOUT (on z/OS) or stdout (on a Unix/Windows system) is written to file.
FILE-NAME = <filename 1..59>
Name of the output file.
CODED-CHARACTER-SET =
Coding (character set) that is to be used to write the data.
CODED-CHARACTER-SET = *STD
The character set predefined by the system is used.
CODED-CHARACTER-SET = <alphanum-name 1..8>
Name of the character set (CCS) that is to be used. This character set must be known in the local system.
This specification must not be combined with DATA-TYPE=*BIN.
DATA-TYPE =
Transfer format for the data.
DATA-TYPE = *CHARACTER
The data is transferred as a text file.
DATA-TYPE = *BINARY
The data is transferred in binary form.
DATA-ENCRYPTION =
Specifies whether the data is to be transferred in encrypted form. The encryption of the request description data is not affected by this operand.
DATA-ENCRYPTION = *NO
The data is transferred unencrypted.
DATA-ENCRYPTION = *YES
The data is transferred encrypted.
FILE-NAME-ENCODING =
Specifies the encoding mode for the commands to be executed in the remote system.
FILE-NAME-ENCODING = *TRANSPARENT
Specification of the commands to be executed in the remote system in transparent mode (compatible to the previous versions).
FILE-NAME-ENCODING = *CHARACTER
Specification of the commands to be executed in the remote system in character mode. The commands are interpreted according to the character code of the remote system, i.e. for Unix partners according to the openFT operating parameter option (ftmodo -fnccs) that has been set there.
FILE-NAME-ENCODING=*CHARACTER is only permitted for openFT partners as of openFT V12.1.
Examples
The partner is a BS2000 system, output to the local file ex.out:
FTEXEC BS2PART,'/SH-FT-LOG ,3 ,OUTPUT=SYSLST',(userId,acct,'passw'),
OUTPUT=*FILE(ex.out),DATA-TYPE=*CHAR
The partner is a Unix system, output to *STDOUT:
FTEXEC PARTUX,'ftshwl -nb=10',uxtransadm,,*CHAR
The partner is a z/OS system:
a) FTEXEC ZOS1,'ftshwopt',transadm
b) FTEXEC ZOS2,'ftshwlog,10,out=*stdout',transadm,out=*file(ex.out)