Using local environment variables with file nodes

You can use fields in the local environment to dynamically alter the behavior of the FileInput, FileOutput, FTEInput, and FTEOutput nodes. You can also find what values the output nodes that are used to process the file.

LocalEnvironment.File fields

When you use the FileInput node, it stores information that you can access in the LocalEnvironment.File message tree. The fields in this structure are described in the following table.
Element Name Element Data Type Description
Directory CHARACTER Absolute directory path of the input directory in the form used by the file system of the integration node. For example, on Windows systems, the directory path starts with the drive letter prefix (such as C:).
Name CHARACTER File name and extension.
LastModified TIMESTAMP Date and time the file was last modified.
TimeStamp CHARACTER Date and time the input node started processing the file in the Coordinated Universal Time (UTC) zone, as a character string. This data is the string that is used to create archive and backout file names if a timestamp is included.
The following elements contain data about the current record:
Offset INTEGER Start of the record within the file. The first record starts at offset 0. If this element is part of the End of Data message tree, this value is the length of the input file.
Record INTEGER Number of the record within the file. The first record is record number 1. If this element is part of the End of Data message tree, this value is the number of records.
Delimiter CHARACTER The characters used to separate this record from the preceding record, if Delimited is specified in Record detection. The first record has a null delimiter. If this element is part of the End of Data message tree, this value is the delimiter that follows the last record, if any.
IsEmpty BOOLEAN Whether the record that is propagated by the message flow is empty. It is set to TRUE if the current record is empty. If this element is part of the End of Data message tree, this value is always set to TRUE.
This structure is propagated with each message that is written to the Out terminal of the FileInput node and with the empty message that is written to the End of data terminal.

LocalEnvironment.File.Read fields

When the FileRead node propagates a message, it stores valid information about it in the LocalEnvironment.File.Read message tree. If the input file is empty, an empty message is propagated. The following table lists the LocalEnvironment.File.Read message tree structure.
Element Name Element Data Type Description
Directory CHARACTER Absolute directory path of the input directory in the form used by the file system of the integration node. For example, on Windows systems, the directory path starts with the drive letter prefix (such as C:).

Alternatively this path relates to the file nodes root directory, which can be overridden with the same environment variable as used for the FileInput and FileOutput nodes.

Name CHARACTER File name and extension.
LastModified TIMESTAMP Date and time the file was last modified.
TimeStamp CHARACTER Date and time the FileRead node started to process the file as a character string, in the Coordinated Universal Time (UTC) zone.
The following elements contain data about the current record:
Offset INTEGER The offset in the file the record starts at. The first byte in the file is offset 0.
NextRecordOffset INTEGER The offset in the file that the next record starts at, relative to the start of the file, and is 1 byte after the end of the current record. If the end of the file is reached, then the value is not given in the local environment.
EndOfFile BOOLEAN The FileRead node sets this element to TRUE after it reads the last record of the input file. It is therefore always TRUE when the detection property is Record is Whole File.
RecordNumber INTEGER The number of the record in the file relative to the offset the read node starts reading from. The value is always 1 unless the filter expression is being used, in which case it reflects the number of the record that was selected.
NoMatchReason STRING The reason why a message is sent to the "No match" terminal. Null if the message is sent to the Out terminal. Possible reasons:
  • NoFile - the file does not exist.
  • NoData - the file exists but has no records.
  • NoRecord - the file exists and contains records but none match the filter expression.
Delimiter CHARACTER The characters used to separate this record from the preceding record, if Delimited is specified in Record detection. The first record has a null delimiter. If this element is part of the End of Data message tree, this value is the delimiter that follows the last record, if any.
IsEmpty BOOLEAN Whether the record that is propagated by the message flow is empty. It is set to TRUE if the current record is empty.
Archive/Directory STRING The name of the directory where the file was archived.
Archive/Name STRING The name of the file where the file was archived.
TransferredFile.FileName CHARACTER If a file is transferred from a remote server, this field contains the name of the file.
TransferredFile.ServerDirectory CHARACTER If a file is transferred from a remote server, this field contains the directory on the remote server that the file was transferred from.
TransferredFile.LocalDirectory CHARACTER If a file is transferred from a remote server, this field contains the integration node's local file system directory that the file was transferred to.
TransferredFile.TimeStamp GMTTIMESTAMP If a file is transferred from a remote server, this field contains a timestamp that represents the time that the file was transferred.
This structure is propagated with each message that is written to the Out terminal of the FileRead node and with the empty message that is written to the End of data terminal.

LocalEnvironment.WrittenDestination.File fields

When you use the FileOutput node, it stores information that you can access in the LocalEnvironment.WrittenDestination.File message tree. The fields in this structure are described in the following table.
Element Name Element Data Type Description
Directory CHARACTER Absolute directory path of the output directory in the form used by the file system of the integration node. For example, on Windows systems, the directory path starts with the drive letter prefix (such as C:).
Name CHARACTER File name of the output file.
Action CHARACTER Possible values are:
  • Replace if an output file of the same name is replaced.
  • Create if a new output file is created.
  • Append if this value is associated with a record that is appended to an output file.
  • Finish if a Finish File message is received and no file is found to finish (for example, if Record is Whole File is specified and a message is sent to the Finish File terminal).
  • Transmit if the file was transferred by FTP or SFTP and the file was not retained.
Timestamp CHARACTER The date and time, in character string form, when the node started to process this file. This value prefixes the names of files that are archived if you specify Time Stamp, Archive, Replace Existing File and Append to Existing File in the Action if file exists property on the Basic tab.

LocalEnvironment.Destination.File fields

When you use the FileOutput and FileRead nodes, you can override the directory and name properties with elements in the message tree. The default location for these overrides is LocalEnvironment.Destination.File, although you can change this location by using the properties on the Request directory property location and Request file name property location on the FileOutput node. When you use the FileRead node, you can also override the length and offset properties. The fields of this structure are described in the following table.
Element Name Element Data Type Description
Directory CHARACTER This property specifies the absolute or relative directory path of the output directory in the form that is used by the file system of the integration node. For example, on Windows systems, this path starts with the drive letter prefix (such as C:) and use a backslash (\) as the directory delimiter. On UNIX systems, the path includes a slash (/) as the directory delimiter.
Name CHARACTER This property specifies the file name of the output file. The FileOutput node does not perform wildcard replacement on the value of the element. For example, if its value is Input*.txt, the FileOutput node tries to write to a file with an asterisk (*) in its name. It might or might not succeed, depending on whether an asterisk is a valid character for files in the file system to which it is writing.
Length INTEGER This property specifies the length of the record to read from the file. The value is only used if the record detection option fixed length is being used.
Offset INTEGER This property specifies the offset in the file to start searching for a record. Offset 0 means start from the beginning and is the default value if no override is given.
Archive/Directory STRING The directory where the file is archived to when you use one of the file disposition archive options. By default the file is archived to 'mqsiarchive' under the file input directory. Any path is not relative to the input directory but relative to the MQSI_FILENODES_ROOT_DIRECTORY.
Archive/Name STRING The pattern to use to create an archive file name. Only one star is allowed in the file name. The star is replaced with the first star replace in the file pattern name. If Archive with Time Stamp is specified, then a timestamp is appended to the archive name.
PosixPermissions CHARACTER A 3-digit octal string that specifies the permissions that are required on the output file. This field uses the same syntax as the syntax that is used in the chmod command; for example, a value of 666 corresponds to rw-rw-rw.

LocalEnvironment.Destination.File.Remote fields

When you use the FileOutput node or the FileRead node with the Remote Transfer property selected, you can override the directory name with an element in the local environment tree. When you use the FileRead node, you can override the remote server with an element in the local environment tree. The fields of this structure are described in the following table.
Element Name Element Data Type Description
Remote.ServerDirectory CHARACTER This property specifies the absolute or relative directory path of the output directory on the remote server. The property has no effect if FTP or SFTP are not enabled on the FileOutput node. Format the path according to the path syntax that is accepted by the FTP server, typically by using UNIX-style slash (/) directory delimiters. This property is supported by the FileOutput and FileRead nodes.
Remote.Server CHARACTER This property can contain either the name of an FTP Server policy, or a string of the form hostname:port. If you set a policy name, all properties that are set to non-default values on the policy are used in preference to the properties that are defined on the node. For a hostname:port string, these values are used when connecting to a remote FTP or SFTP server.

LocalEnvironment.Wildcard.WildcardMatch field

On the FileInput, CDInput, and FTEInput nodes, you can specify a file name pattern that contains wildcard characters. The input nodes copy the characters in the file name that are matched by wildcards, together with any intermediate characters, to LocalEnvironment.Wildcard.WildcardMatch.
Element Name Element Data Type Description
WildcardMatch CHARACTER The character string in the file name matched by wildcards in the file name pattern.

On the FileOutput, CDOutput, and FTEOutput nodes, you can use a wildcard character in the file name pattern. If you include the single wildcard character, '*', in the file name pattern, the node uses the value that is stored in LocalEnvironment.Wildcard.WildcardMatch. This value is useful if you have a message flow where the input and output nodes are working with the same file. You can preserve the name of the input file on the output nodes. You can also use standard methods for manipulating the value of the WildcardMatch element to whatever you want. You must not use a FileInput, CDInput, or FTEInput node.

For more information, see File name patterns.

LocalEnvironment.FTE fields

When you use the FTEInput node, it stores information that you can access in the LocalEnvironment.FTE and LocalEnvironment.FTE.Transfer message trees. The LocalEnvironment.FTE message tree stores information that relates to the current record and is populated by the integration node. The fields in this structure are described in the following table:
Element Name Element Data Type Description
TimeStamp CHARACTER Date and time the input node started processing the file in the Coordinated Universal Time (UTC) zone, as a character string. This data is the string that is used to create archive and backout file names if a timestamp is included.
Offset INTEGER Start of the record within the file. The first record starts at offset 0 bytes. When Offset is part of the End of Data message tree, this value is the length of the input file.
Record INTEGER Number of the record within the file. The first record is record number 1. When Record is part of the End of Data message tree, this value is the number of records.
Delimiter CHARACTER The characters used to separate this record from the preceding record, if Delimited is specified in Record detection. The first record has a null delimiter. When Delimiter is part of the End of Data message tree, this value is the delimiter that follows the last record, if any.
IsEmpty BOOLEAN Whether the record that is propagated by the message flow is empty. IsEmpty is set to TRUE if the current record is empty. When IsEmpty is part of the End of Data message tree, this value is always set to TRUE.
The LocalEnvironment.FTE.Transfer message tree contains information that is received from IBM® MQ File Transfer Edition regarding the transfer or file. For more information, see WebSphere® File Transfer Edition product documentation. The fields in this structure are described in the following table.
Element Name Element Data Type Description
Directory CHARACTER Absolute directory path of the input directory.
JobName CHARACTER The name for the transfer.
Name CHARACTER File name and extension (per file).
LastModified TIMESTAMP Date and time the file was last modified (per file).
SourceAgent CHARACTER The name of the agent that sends the file.
DestinationAgent CHARACTER The name of the agent to send the file to.
OriginatingHost CHARACTER The name of the host from which the transfer was submitted.
TransferId CHARACTER The unique name of the transfer.
MQMDUser CHARACTER The IBM MQ user ID in the MQMD of the transfer request message.
OriginatingUser CHARACTER The user ID of the user that submitted the transfer request.
TransferMode CHARACTER The mode of the transfer. Valid values are Binary or Text.
TransferStatus CHARACTER The status of the transfer of the file.
FileSize INTEGER The size of the file that is being transferred.
ChecksumMethod CHARACTER The only allowed value is MD5.
Checksum CHARACTER If the ChecksumMethod element is set to MD5, this element is the actual checksum in hex string format.
DestinationAgentQmgr CHARACTER The name of the queue manager of the destination agent to send the file to.
SourceAgentQmgr CHARACTER The name of the queue manager of the source agent that sent the file.
OverallTransferStatus CHARACTER The overall status of the transfer.
TotalTransfers INTEGER The total number of files successfully transferred.
TransferNumber INTEGER The number of the current file in the transfer.
These structures are propagated with each message that is written to the Out terminal of the FTEInput node and with the empty message that is written to the End of data terminal.

LocalEnvironment.WrittenDestination.FTE fields

When you use the FTEOutput node, it stores information that you can access in the LocalEnvironment.WrittenDestination.FTE message tree. The fields in this structure are described in the following table.
Element Name Element Data Type Description
DestinationAgent CHARACTER The name of the agent to send the file to.
DestinationQmgr CHARACTER The name of the destination queue manager.
JobName CHARACTER The name for the transfer.
Directory CHARACTER Absolute directory path of the output directory in the form used by the file system of the integration node. For example, on Windows systems, the directory path starts with the drive letter prefix (such as C:).
Name CHARACTER File name of the output file.
Overwrite BOOLEAN Specifies whether files on the destination system can be overwritten when the destination agent moves files of the same name there. If the destination agent fails to overwrite the file, the transfer fails and the transfer logs report the failure. The FTEOutput node does not throw or log any errors.
TransferId CHARACTER The unique name of the transfer initiated by the FTEOutput node.

LocalEnvironment.Destination.FTE fields

When you use the FTEOutput node, you can override its Destination agent, Destination queue manager, Job name, Destination file directory, Destination file name, and Overwrite files on destination system properties with elements in the message tree. You can also call a program on the destination agent before you start the transfer, or when the transfer is finished. The default location for these overrides is LocalEnvironment.Destination.FTE. The fields of this structure are described in the following table.
Element Name Element Data Type Description
DestinationAgent CHARACTER The name of the agent to send the file to.
DestinationQmgr CHARACTER The name of the destination queue manager.
JobName CHARACTER The name for the transfer.
Directory CHARACTER Absolute directory path of the output directory in the form used by the file system of the integration node. For example, on Windows systems, the directory path starts with the drive letter prefix (such as C:).
Name CHARACTER File name of the output file.
Overwrite BOOLEAN Specifies whether files on the destination system can be overwritten when the destination agent moves files of the same name there. If the destination agent fails to overwrite the file, the transfer fails and the transfer logs report the failure. The FTEOutput node does not throw or log any errors.
PreDestinationCall.Name CHARACTER Call a program on the destination agent before the transfer starts.
This element supplies the name of an Ant script to run. The Ant script can access all the metadata that is defined for the transfer, including user metadata added by using the local environment override LocalEnvironment.Destination.FTE.UserDefined. You must be aware of the following restrictions:
  • You cannot call other programs that are not Ant scripts, or pass parameters to the calls.
  • The destination agent cannot be an FTE agent that is embedded in an integration server process.
See WebSphere File Transfer Edition product documentation for more details of how to use the PreDestinationCall function.
PostDestinationCall.Name CHARACTER Call a program on the destination agent after the transfer is completed.
This element supplies the name of an Ant script to run. The Ant script can access all the metadata that is defined for the transfer, including user metadata added by using the local environment override LocalEnvironment.Destination.FTE.UserDefined. You must be aware of the following restrictions:
  • You cannot call other programs that are not Ant scripts, or pass parameters to the calls.
  • The destination agent cannot be an FTE agent that is embedded in an integration server process.
See WebSphere File Transfer Edition product documentation for more details of how to use the PostDestinationCall function.

LocalEnvironment.CD fields

When you use the CDInput node, it stores information that you can access in the LocalEnvironment.CD and LocalEnvironment.CD.Transfer message trees. The LocalEnvironment.CD message tree stores information that relates to the current record and is populated by the integration node. The fields in this structure are described in the following table:
Element Name Element Data Type Description
Transfer Folder Contains metadata from the IBM Sterling Connect:Direct® transfer.
Timestamp CHAR Timestamp of the file.
Offset INTEGER Start of the record within the file. The first record starts at offset 0 bytes. When Offset is part of the End of Data message tree, this value is the length of the input file.
Record INTEGER Number of the record within the file. The first record is record number 1. When Record is part of the End of Data message tree, this value is the number of records.
Delimiter CHARACTER The characters used to separate this record from the preceding record, if Delimited is specified in Record detection. The first record has a null delimiter. When Delimiter is part of the End of Data message tree, this value is the delimiter that follows the last record, if any.
IsEmpty BOOLEAN Whether the record that is propagated by the message flow is empty. IsEmpty is set to TRUE if the current record is empty. When IsEmpty is part of the End of Data message tree, this value is always set to TRUE.
These structures are propagated with each message that is written to the Out terminal of the CDInput node and with the empty message that is written to the End of data terminal.

LocalEnvironment.CD.Transfer

The LocalEnvironment.CD.Transfer message tree contains information that is received from IBM Sterling Connect:Direct regarding the transfer or file. The fields in this structure are described in the following table.
Element Name Element Data Type Description
ProcessName CHARACTER The process name of the script that transfers the file.
StepName CHARACTER The name of the step that causes the transfer to take place.
ProcessNumber INTEGER The number of the process that is running the process script.
Submitter CHAR The user ID submitting the process script.
Accounting CHAR The secondary node (SNODE) accounting details for the process script.
SourcePath CHAR The source path of the file on the primary node (PNODE) machine.
DestinationPath CHAR The destination path of the file on the secondary node (SNODE) machine
Directory CHARACTER The directory that the file is copied to.
Name CHARACTER The name of the file that is copied to.
PrimaryNodeName CHARACTER The name of the primary node from which the file was copied.
SecondaryNodeName CHARACTER The name of the secondary node.

LocalEnvironment.Destination.CD fields

When you use the CDOutput node, you can override various destination system properties with elements in the message tree. The default location for these overrides is LocalEnvironment.Destination.CD. The fields of this structure are described in the following table
Element Name Element Data Type Description
SNODE CHARACTER The name of the secondary Connect:Direct server (SNODE) to send the file to.
SNODEID CHARACTER The user ID and password of the secondary Connect:Direct server (SNODEID) to send the file to.
ProcessName CHARACTER The process name that the script uses to run.
Accounting CHARACTER Accounting data shown when the script is running on both the primary Connect:Direct server (PNODE) and secondary Connect:Direct server (SNODE).
Directory CHARACTER Absolute directory path of the output directory in the form used by the file system of the integration node. For example, on Windows systems, the directory path starts with the drive letter prefix (such as C:).
Name CHARACTER File name of the output file.
Copy.From CHARACTER The final part of the path name is the IBM Sterling Connect:Direct process script property that you want to change.

This property is either a direct option name on the FROM clause, or a value in the SYSOPTS option.

You must take care to ensure that the created script is valid because any existing value that is created by the node is overridden.

Copy.To CHARACTER The final part of the path name is the IBM Sterling Connect:Direct process script property that you want to change.

This property is either a direct option name on the TO clause, or a value in the SYSOPTSSYSOPTS option.

You must take care to ensure that the created script is valid because any existing value that is created by the node is overridden.

LocalEnvironment.WrittenDestination.CD fields

When you use the CDOutput node, it stores information that you can access in the LocalEnvironment.WrittenDestination.CD message tree. The fields in this structure are described in the following table.
Element Name Element Data Type Description
ProcessName CHARACTER The name of the process that is sending the file.
ProcessNumber CHARACTER The number of the process that is sending the file.
Directory CHARACTER Absolute directory path of the output directory in the form used by the file system of the integration node. For example, on Windows systems, the directory path starts with the drive letter prefix (such as C:).
Name CHARACTER File name of the output file.
PrimaryNodeName CHARACTER The name of the primary Connect:Direct server (PNODE)
PrimaryNodeOS CHARACTER The operating system of the primary Connect:Direct server
SecondaryNodeName CHARACTER The name of the secondary Connect:Direct server (SNODE)
SecondaryNodeOS CHARACTER The operating system of the secondary Connect:Direct server (this operating system might not be the same as the IBM App Connect Enterprise operating system)