Setting the Record definition property for the FileOutput and FTEOutput nodes
Set the properties on theRecords and Elements tab of the node to write files in different formats.
- Three input messages which are sent, in this order, to the In
terminal of the FileOutput node:
- Message 1:
<Message>test1</Message>
- Message 2:
<Message>testtwo</Message>
- Message 3:
<Message>testthree</Message>
<Message>...</Message>
- Message 1:
- A final message which is sent to the Finish File terminal of the FileOutput node after the first three messages have been sent. It does not matter what this message contains.
Example 1. Records written are separated by a DOS or UNIX line end
This example is identical to the one described in Writing a file to your local file system or Writing a file to a remote FTP, FTPS, or SFTP server. Specify the node's properties as described in Writing a file to your local file system or Writing a file to a remote FTP, FTPS, or SFTP server.
<Message>test1</Message>
<Message>testtwo</Message>
<Message>testthree</Message>
Example 2. Records written are separated by a custom delimiter
Property | Value |
---|---|
Record definition | Record is Delimited Data |
Delimiter | Custom Delimiter |
Custom delimiter | 0D0A |
Delimiter type | Postfix |
Example 3. Records written are padded to a fixed length
Property | Value |
---|---|
Record definition | Record is Fixed Length Data |
Length (bytes) | 30 |
Padding bytes (hexadecimal) | 2A |
The length of each incoming message is 24 bytes, 26 bytes, and 28 bytes respectively. The required fixed length of each record is 30 bytes. Each record is therefore padded by an extra 6 bytes, 4 bytes, and 2 bytes respectively, using the hexadecimal character X'2A'.
<Message>test1</Message>******<Message>testtwo</Message>****<Message>testthree</Message>**
Example 4. Records written are not separated by delimiters or padding
Property | Value |
---|---|
Record definition | Record is Unmodified Data |
The records are concatenated with no padding or delimiters.
One file is written with the following content:<Message>test1</Message><Message>testtwo</Message><Message>testthree</Message>
There
are no trailing bytes or line terminators.Example 5. Records are written as whole files
Property | Value |
---|---|
Record definition | Record is Whole File |
- File 1:
<Message>test1</Message>
- File 2:
<Message>testtwo</Message>
- File 3:
<Message>testthree</Message>
After optional transfer, if a copy is retained, each file is moved to the output directory, C:\FileOutput\TestDir. In accordance with the properties on the FileOutput node as described in Writing a file to your local file system or Writing a file to a remote FTP, FTPS, or SFTP server, the second file moved displaces the first file from the output directory which is moved to the mqsiarchive subdirectory with a time stamp added to the file name. When the third file is moved to the output directory, it displaces the second file, causing it to be moved to the mqsiarchive subdirectory and renamed. The final result is files similar to these:
C:\FileOutput\TestDir\mqsiarchive\20071101_165346_312030_test_output1.xml
C:\FileOutput\TestDir\mqsiarchive\20071101_165347_312030_test_output1.xml
C:\FileOutput\TestDir\test_output1.xml
being File 1, File
2, and File 3 respectively. If FTP processing was enabled, File 3
would also be in the remote FTP server directory and called test_output1.xml.