fteCreateTemplate (create new file transfer template)
The fteCreateTemplate command creates a file transfer template that you can keep for future use. The only required parameter is the -tn template_name parameter. All other parameters are optional, although if you specify a source file specification, you must also provide a destination file. Similarly, if you specify a destination file, you must also specify a source file specification.
Purpose
Use the fteCreateTemplate command to create a file transfer template that stores your transfer details until you want to use them at a later date. Use transfer templates to store common file transfer settings for repeated or complex transfers. After you have created a transfer template, submit the template using the IBM® MQ Explorer. You cannot submit a transfer template from the command line.The transfer template that you create using the fteCreateTemplate command is not the same as the XML message that you create using the -gt parameter on the fteCreateTransfer command. You cannot use the two different types of template interchangeably.
You can run the fteCreateTemplate command from any system that can connect to the IBM MQ network and then route to the coordination queue manager. Specifically for the command to run, you must have installed Managed File Transfer on this system and you must have configured the Managed File Transfer component on this system to communicate with the IBM MQ network.
You can specify multiple source files for a file transfer but only one destination agent; transferring one file to multiple destination agents is not supported. However, you can transfer multiple source files to multiple destination files on a single destination agent.
For guidance about how to transfer files, see Guidelines for transferring files.
Special characters
Take care when you use parameters that contain special characters so that you avoid the command shell interpreting the characters in a way you do not expect. For example, fully qualified data set names that contain single quotation marks and source specifications that contain asterisk characters might be interpreted by the command shell rather than being passed through in the transfer request.To avoid characters being interpreted by the command shell, enclose the entire parameter in double quotation marks as shown in the final two examples Examples, or escape the special characters using the escape sequence of the command shell.
Relative paths
transferRoot=directory_name
You must escape Windows paths or write them in UNIX format. For example, specify
C:\TransferRoot as C:\\TransferRoot or
C:/TransferRoot.
transferRootHLQ=prepend_value
However, for transfers that involve a Connect:Direct® node on a z/OS system, the data set specification is interpreted as a fully qualified name. No
high-level qualifier is added to the data set name.Syntax
Parameters
- -sa source_agent_name
- Optional. The name of the agent that the source file is transferred from. If you do not specify this agent name when you create the template, you must specify the source agent name when you use the template.
- -sm source_agent_qmgr_name
- Optional. The name of the queue manager that the source agent is connected to.
- -da destination_agent_name
- Optional. The name of the agent that the file is transferred to. If you do not specify the destination agent name when you create the template, you must specify the destination agent name when you use the template.
- -dm destination_agent_qmgr_name
- Optional. The name of the queue manager that the destination agent is connected to.
- -td transfer_definition_file
- Optional. The name of the XML document that defines one or more source and destination file specifications for the transfer.
- -df destination_file
- Optional. The name of the destination file. Specify a file name that is valid on the system
where the destination agent is running.
If the destination agent is a Connect:Direct bridge agent, the destination file is specified in the format connect_direct_node_name:file_path. The Connect:Direct bridge agent accepts only file paths that are specified in this format. If the destination agent is a Connect:Direct bridge agent and the destination is a PDS member, you must also specify the -de parameter with a value of overwrite.
- -dd destination_directory
- Optional. The name of the directory the file is transferred to. Specify a directory name that is
valid on the system where the destination agent is running.
If the destination agent is a Connect:Direct bridge agent, the destination directory is specified in the format connect_direct_node_name:directory_path. If the destination agent is a Connect:Direct bridge agent and the destination is a PDS, you must also specify the -de parameter with a value of overwrite.
- -ds destination_sequential_data_set
- z/OS only. Optional. The name of the sequential data set or PDS member that files are transferred into. Specify a sequential data set name or a partitioned data set member.
- -dp destination_partitioned_data_set
- z/OS only. Optional. The name of the destination PDS that files are transferred into. Specify a partitioned data set name. If a PDS is created as a result of the transfer, this PDS is created as a PDSE by default. You can override the default by specifying DSNTYPE=PDS.
- -du destination_user
- Optional. The name of the user whose destination file space the files are transferred into. .
- -dq destination_queue
- Optional. The name of a destination queue that files are transferred onto. You can optionally include a queue manager name in this specification, using the format QUEUE@QUEUEMANAGER. If you do not specify a queue manager name, the destination agent queue manager name is used if you have not set the enableClusterQueueInputOutput agent property to true. If you have set the enableClusterQueueInputOutput agent property to true, the destination agent uses standard IBM MQ resolution procedures to determine where the queue is located. You must specify a valid queue name that exists on the queue manager.
- -dqp persistent
- Optional. Specifies whether messages written to the destination queue are persistent. The valid
options are as follows:
- true
- Writes persistent messages to the destination queue. This is the default value.
- false
- Writes non-persistent messages to the destination queue.
- qdef
- The persistence value is take from the DefPersistence attribute of the destination queue.
- -qmp boolean
- Optional. Specifies whether the first message written to the destination queue by the transfer
has IBM MQ message properties set. The valid options are
as follows:
- true
- Sets message properties on the first message created by the transfer.
- false
- Does not set message properties on the first message created by the transfer. This is the default value.
- -qs message_size
- Optional. Specifies whether to split the file into multiple fixed-length messages. All the
messages have the same IBM MQ group ID; the last message
in the group has the IBM MQ LAST_MSG_IN_GROUP flag set.
The size of the messages is specified by the value of message_size. The format of
message_size is lengthunits, where
length is a positive integer value and units is one of the
following values:
B
- Bytes. The minimum value allowed is two times the maximum bytes-per-character value of the code page of the destination messages.
K
- This is equivalent to 1024 bytes.
M
- This is equivalent to 1048576 bytes.
- -dqdb hexadecimal_delimiter
- Optional. Specifies the hexadecimal delimiter to use when splitting a binary file into multiple
messages. All the messages have the same IBM MQ group
ID; the last message in the group has the IBM MQ
LAST_MSG_IN_GROUP flag set. The format for specifying a hexadecimal byte as a delimiter is
xNN
, whereN
is a character in the range0-9
ora-f
. You can specify a sequence of hexadecimal bytes as a delimiter by specifying a comma-separated list of hexadecimal bytes, for example:x3e,x20,x20,xbf
. - -dqdt pattern
- Optional. Specifies the regular expression to use when splitting a text file into multiple
messages. All the messages have the same IBM MQ group
ID; the last message in the group has the IBM MQ
LAST_MSG_IN_GROUP flag set. The format for specifying a regular expression as a delimiter is a
regular expression enclosed in parentheses,
(regular_expression)
. The value of this parameter is evaluated as a Java regular expression. For more information, see Regular expressions used by MFT. - -dqdp
- Optional. Specifies the expected position of destination text and binary delimiters when splitting files. You can only specify the -dqdp parameter if you have also specified one of the -dqdt and -dqdb parameters.
- -qi
- Optional. Specifies whether to include the delimiter that is used to split the file into multiple messages in the messages. If -qi is specified, the delimiter is included at the end of the message that contains the file data preceding the delimiter. By default the delimiter is not included in the messages.
- -de destination_file_behavior
- Optional. Specifies the action that is taken if a destination file exists on the destination
system. The valid options are as follows:
- error
- Reports an error and the file is not transferred. This is the default value.
- overwrite
- Overwrites the existing destination file.
- -sd source_file_disposition
- Optional. Specifies the action that is taken on a source file when that source file has
successfully been transferred to its destination. The valid options are as follows:
- leave
- The source files are left unchanged. This is the default value.
- delete
- The source file is deleted from the source system after the source file is successfully transferred.
On z/OS, if the source is a tape data set and you specify the delete option, the tape is remounted to delete the data set. This behavior is because of the behavior of the system environment.
If the source is a queue and you specify the leave option, the command returns an error and a transfer is not requested.
If the source agent is a Connect:Direct bridge agent and you specify the delete option, the behavior is different to the usual source disposition behavior. One of the following cases occurs:- If Connect:Direct uses a process that is generated by Managed File Transfer to move the file or data set from the source, specifying the delete option causes the transfer to fail. To specify that the source file is deleted, you must submit a user-defined Connect:Direct process. For more information, see Submitting a user-defined Connect:Direct process from a file transfer request.
- If Connect:Direct uses a user-defined process to move the file or data set from the source, this parameter is passed to the process through the %FTEFDISP intrinsic symbolic variable. The user-defined process determines whether the source is deleted. The result that the transfer returns depends on the result that is returned by the user-defined process.
- -pr transfer_priority
- Optional. Specifies the priority level of the transfer. Priority is a value in the range 0-9, where 0 is the lowest priority. The default priority level is 0 and by default the transfer uses the priority level of the source agent.
- -rt transfer_recovery_timeout
- Optional. Sets the amount of time, in seconds, during which a source agent keeps trying to
recover a stalled file transfer. Specify one of the following options:
-1
- The agent continues to attempt to recover the stalled transfer until the transfer is complete. Using this option is the equivalent of the default behavior of the agent when the property is not set.
0
- The agent stops the file transfer as soon as it enters recovery.
>0
- The agent continues to attempt to recover the stalled transfer for the amount of time in seconds
as set by the positive integer value specified. For example,
indicates that the agent keeps trying to recover the transfer for 6 hours from when it enters recovery. The maximum value for this parameter is-rt 21600
999999999
.
- -p configuration_options
- Optional. This parameter determines the set of configuration options that is used to create the transfer template. Use the name of a non-default coordination queue manager as the input for this parameter. The command then uses the set of properties files associated with this non-default coordination queue manager.
- -r
- Optional. Recursively transfer files in subdirectories when source_specification contains wildcard characters. When Managed File Transfer is presented with a wildcard character as a source_specification, any directories that match the wildcard character are transferred only if you have specified the -r parameter. When source_specification matches a subdirectory, all files in that directory and its subdirectories (including hidden files) are always transferred.
- -t
- Optional. Specifies the type of file transfer: binary mode or text mode.
- binary
- The data in the file is transferred without any conversion. This is the default value.
- text
- The code page and end-of-line characters of the file are converted. The exact conversions performed depend on the operating systems of the source agent and destination agent.
- -cs
- Optional. Specifies whether a checksum algorithm is run on the file transfer data to check the
integrity of the transferred files. Specify one of the following options:
- MD5
- Computes an MD5 checksum for the data. The resulting checksum for the source and destination files is written to the transfer log for validation purposes. By default, Managed File Transfer computes MD5 checksums for all file transfers.
- none
- No MD5 checksum is computed for the file transfer data. The transfer log records that checksum
was set to none and the value for the checksum is blank. For example:
If you use the none option, you might improve file transfer performance, depending on your environment. However, selecting this option means that there is no validation of the source or destination files.<checksum method="none"></checksum>
- -tr
- Optional. Specifies a condition that must be true for this file transfer to take place. If the
condition is not true, according to the source agent, the file transfer is discarded and no transfer
takes place. Specify the following format:
where condition is one of the following values:condition,namelist
- file=exist
- A minimum of one of the files in the namelist exists. That is, if any of the files in the namelist exists, the condition is true.
- file!=exist
- A minimum of one of the files in the namelist does not exist. That is, if any of the files in the namelist do not exist, the condition is true.
- filesize>=size
- A minimum of one of the files in the namelist exists and has a minimum size as specified by
size. The value of size is an integer with an optional size unit of KB, MB, or GB. For
example,
filesize">"=10KB
. If you do not specify a size unit, the size is assumed to be bytes. On all operating systems, you must enclose the greater than symbol (>) in double quotation marks when you specify the filesize option on the command line, as shown in this example.
- -tl
- Optional. Specifies whether trigger failures are logged. Specify one of the following options:
- yes
- Log entries are created for failed triggered transfers. This is the default behavior even if you do not specify the -tl parameter.
- no
- No log entries are created for failed triggered transfers.
- -md
- Optional. Specifies the user-defined metadata that is passed to the exit points of the agent. The -md parameter can take one or more name-value pairs separated by commas. Each name pair consists of name=value. You can use the -md parameter more than once in a command.
- -tb
- Optional. Specifies the time base you want to use for the scheduled file transfer. That is,
whether you want to use a system time or Coordinated Universal Time (UTC). You must use this
parameter with the -ss parameter only. Specify one of the following options:
- admin
- The start and end times used for the scheduled transfer are based on the time and date of the system used by the administrator. This is the default value.
- source
- The start and end times used for the scheduled transfer are based on the time and date of the system where the source agent is located.
- UTC
- The start and end times used for the scheduled transfer are based on Coordinated Universal Time (UTC).
- -jn job_name
- Optional. A user-defined job name identifier that is added to the log message when the transfer has started.
- -ss schedule_start_time
- Optional. Specifies the time and date that you want the scheduled transfer to take place. Use
one of the following formats to specify the time and date. Specify the time using the 24-hour clock:
yyyy-MM-ddThh:mm hh:mm
- -oi
- Optional. Specifies the interval that the scheduled transfer occurs at. You must use this
parameter with the -ss parameter only. Specify one of the following options:
- minutes
- hours
- days
- weeks
- months
- years
- -of occurrence_frequency
- Optional. Specifies the frequency that the scheduled transfer occurs at. For example, every 5 weeks or every 2 months. You must specify this parameter with the -oi and -ss parameters only. If you do not specify this parameter, a default value of 1 is used.
- -oc occurrence_count
- Optional. Specifies how many times you want this scheduled transfer to occur. After the occurrence count has been met, the scheduled transfer is deleted.
- -es schedule_end_time
- Optional. The time and date that a repeating scheduled transfer ends.
- -tn template_name
- Required. The name of the template that you want to create. Use a descriptive string that allows you to select the correct template for transfers at a later date. There is no specific limit to the length of this string, but be aware that excessively long names might not be displayed properly in some user interfaces.
- -sqgi
- Optional. Specifies that the messages are grouped by IBM MQ group ID. The first complete group is written to the destination file. If this parameter is not specified, all messages on the source queue are written to the destination file.
- -sqdt text_delimiter
- Optional. Specifies a sequence of text to insert as the delimiter when appending multiple
messages to a text file. You can include Java escape
sequences for String literals in the delimiter. For example,
-sqdt \u007d\n
. - -sqdb hexadecimal_delimiter
- Optional. Specifies one or more byte values to insert as the delimiter when appending multiple
messages to a binary file. Each value must be specified as two hexadecimal digits in the range
00-FF
, prefixed byx
. Multiple bytes must be comma-separated. For example,-sqdb x08,xA4
. - -sqdp
- Optional. Specifies the position of insertion of source text and binary delimiters. You can only specify the -sqdp parameter if you have also specified one of the -sqdt and -sqdb parameters.
- -sqwt wait_time
- Optional. Specifies the time, in seconds, to wait for one of the following conditions to be met:
- For a new message to be put on the queue
- If the -sqgi parameter was specified, for a complete group to be put on the queue
- -sq
- Optional. Specifies that the source of a transfer is a queue.
- -mquserid user_id
- Optional. Specifies the user ID to authenticate with the coordination queue manager.
- -mqpassword password
- Optional. Specifies the password to authenticate with the coordination queue manager. You must also specify the -mquserid parameter. If you specify -mquserid, but do not specify -mqpassword, you will be prompted to supply the associated password. The password will not be displayed.
- source_specification
- Required if you have specified one of the -df, -dd,
-dp, -dp, or -ds parameters. If you
specify the -td parameter, do not specify
source_specification.
- If you have not specified the -sq parameter,
source_specification is one or more file specifications that determine the
source, or sources, for the file transfer. File specifications are space delimited. File
specifications can take one of five forms and can include wildcard characters. For more information
about wildcard characters in WMQFTE, see Using wildcard characters with MFT. You can escape asterisks
that are part of the file specification by using two asterisk characters (**) in the file
specification. To transfer files containing spaces in their file names, place double quotation marks around the file names that contain spaces. For example to transfer fileEach file specification must be in one of the following formats:
a b.txt
to filec d.txt
specify the following text as part of the fteCreateTemplate command:-df "c d.txt" "a b.txt"
- File names
- The name of a file, expressed using the appropriate notation for the system where the source agent is running. When a file name is specified as a source file specification, the contents of the file are copied.
- Directories
- The name of a directory, expressed using the appropriate notation for the system where the source agent is running. When a directory is specified as a source file specification, the contents of the directory are copied. More precisely, all files in the directory and in all its subdirectories, including hidden files, are copied.
- Sequential data set
- (z/OS only). The name of a sequential data set or partitioned data set member. Denote data sets by preceding the data set name with two forward slash characters (//).
- Partitioned data set
- (z/OS only). The name of a partitioned data set. Denote data set names by preceding the data set name with two forward slash characters (//).
- File name or directory at a Connect:Direct node
- (Connect:Direct bridge agent only). The name of a
Connect:Direct node, a colon character (:), and a file or
directory path on the system that is hosting the Connect:Direct node. For example,
connect_direct_node_name:file_path.
If the source agent is a Connect:Direct bridge agent, it will only accept source specifications in this form.
Note: Wildcard characters are not supported in file paths when the source agent is a Connect:Direct bridge agent.
- If you have specified the -sq parameter,
source_specification is the name of a local queue on the source agent queue
manager. You can specify only one source queue. The source queue is specified in the format:
The queue manager name is not included in the source queue specification, because the queue manager must be the same as the source agent queue manager.QUEUE_NAME
- If you have not specified the -sq parameter,
source_specification is one or more file specifications that determine the
source, or sources, for the file transfer. File specifications are space delimited. File
specifications can take one of five forms and can include wildcard characters. For more information
about wildcard characters in WMQFTE, see Using wildcard characters with MFT. You can escape asterisks
that are part of the file specification by using two asterisk characters (**) in the file
specification.
- -? or -h
- Optional. Displays command syntax.
Examples
payroll accounts monthly report
template
is created. When submitted, this template transfers any file with the extension
.xls from the agent PAYROLL1 to the agent ACCOUNTS in the directories specified:
fteCreateTemplate -tn "payroll accounts monthly report template" -sa PAYROLL -sm QM_PAYROLL1 -da ACCOUNTS
-dm QM_ACCOUNTS -df C:\payroll_reports\*.xls C:\out\*.xls
jupiter_neptune_sched_template
is
created. When submitted, the template transfers the file originalfile.txt from
the system where QM_JUPITER is located to the system where QM_NEPTUNE is located. The file transfer
is scheduled to take place at 09:00 based on the system time of the system where the source agent is
located and occurs every two hours four
times:fteCreateTemplate -tn jupiter_neptune_sched_template -sa AGENT1 -sm QM_JUPITER -da AGENT2 -dm QM_NEPTUNE
-tb source -ss 09:00 -oi hours -of 2 -oc 4
-df C:\import\transferredfile.txt C:\export\originalfile.txt
jupiter neptune trigger template
is
created. When the template is submitted, the file originalfile.txt is
transferred from AGENT1 to AGENT2, on condition that the file A.txt exists on
AGENT1:fteCreateTemplate -tn "jupiter neptune trigger template" -sa AGENT1 -sm QM_JUPITER -da AGENT2 -dm QM_NEPTUNE
-tr file=exist,C:\export\A.txt -df C:\import\transferredfile.txt C:\export\originalfile.txt
ascii_ebcidic_template
is
created. When the template is submitted, the file originalfile.txt is
transferred from the system where AGENT1 is located to a data set //'USERID.TRANS.FILE.TXT' on the
system where AGENT2 is located. Text mode has been selected to convert data from ASCII to EBCDIC.
fteCreateTemplate -tn ascii_ebcidic_template -t text -sa AGENT1 -da AGENT2
-ds "//TRANS.FILE.TXT;RECFM(V,B);BLKSIZE(6144);LRECL(1028);
SPACE(5,1)" C:\export\originalfile.txt
ebcidic_ascii_template
is
created. When the template is submitted, a member of a fully qualified data set on the system where
AGENT1 is located is transferred to a file on the system where AGENT2 is located. Text mode has been
selected to convert the file from EBCDIC to ASCII.
fteCreateTemplate -tn ebcidic_ascii_template -t text -sa AGENT1 -da AGENT2 -df /tmp/IEEUJV.txt "//'SYS1.SAMPLIB(IEEUJV)'"
Return codes
Return code | Description |
---|---|
0 | Command completed successfully. |
1 | Command ended unsuccessfully. |