Creating file schemas

File schemas can be used to define the contents of one or more files that you intend to write to (publish) or read from (subscribe) in Rational® Integration Tester tests.

About this task

For files that are made up of a number of records, a file schema can save you from having to write to or read from a file over and over again (that is, creating a publisher or subscriber for each record in the file). The file schema lets Rational Integration Tester iterate over the entire file, reading the wanted records according to the way the file is defined.

The file schema is used with the File Contents resource (created in the Logical View of Architecture School), which defines the file that contains the records to be processed. For more information about working with files in Rational Integration Tester, refer to Working with File transport.

The following example illustrates how to create a file schema that defines a file contents resource.

Procedure

  1. In Rational Integration Tester, create a project or open an existing one.
  2. In the Logical view of the Architecture School perspective, create a file resource by selecting File from the Files menu.
  3. Provide a name for the file resource and double-click to edit it.
  4. Under the Settings tab, click Browse next to File Name and select the file to be processed in Rational Integration Tester tests.
  5. Click OK to save the changes and close the File Contents editor.
  6. In the Schema Library view of the Architecture School perspective, click the arrow next to the Add button, then click Other > File Schema.
    Note: Records within the file are treated as byte fields. Currently, only COBOL Copybook schemas can be used for defining file records.
  7. Click to add a file schema.
  8. Enter a name for the schema that is based on the file type with which it is used.
  9. On the right side of the Schema Library view, the file schema definition is displayed on the Config > Layout page.
  10. Add records (that is, the schemas that are imported earlier that define the file records) to the file schema by using the New Record button.
  11. In the Schema wizard, select the wanted schema (or add one) and click Finish.
  12. Add conditions to the defining records by using the New Condition button.
    The new condition window

    Conditions are used to help Rational Integration Tester understand the structure of the file that is being processed. If available for a condition, you can select a field within the record to use for matching the condition in the Value field.

    In the example file schema that is shown below, the file contains a header record, a number of account records, and a trailer (footer) record. Within each account record, one or more account detail records can appear.

    Detail records for each account

    Record definitions can be moved and deleted by using the Remove Record, Move Up, and Move Down buttons. Conditions cannot be moved, but they can be deleted by using the Remove Condition button.

    When finished, or at any time, you can click the Preview button to apply the file schema to the file to be processed, ensuring that the structure of the file is defined properly.

  13. In the Preview dialog, click Browse to select the File Contents resource (created in the Logical View) that defines the file to be processed.
  14. Select the wanted encoding type to apply from the Source Encoding dropdown menu.

    A preview of the file to be processed is displayed.

    Preview of file schema
  15. On the Config > Settings page, you can specify a number for the Records to ignore at the start of file field. The remaining fields that are displayed depend on the value of the Type field.

    For All Available Bytes and Swift type records, no further information is required.

    For Split type records, see the following table:
    Table 1. Fields for Split type records
    Field Description
    Update outbound message with packet details below You can update outbound messages with the length of the remaining data for delimited records. To include this information in outbound messages (that is, when publishing), select the Update outbound message with packet details option.
    [Delimiters] Select one of the following delimiters:
    • Comma
    • Tab
    • Space
    • Semi-colon
    • Other

    If you choose Other, you must specify a delimiting character.

    Process last empty packet Valid when reading records. Select this option if the record ends with the delimiter you specified previously and you want to process one more packet as an empty string (""). Clear this option if the delimiter indicates that there are no more packets.
    Write token with last packet Valid when writing records. Select this option if you want the packetizer to write a final delimiter character at the end of the file.
    For Length delimited records, see the following table:
    Table 2. Fields for length-delimited records
    Field Description
    Update outbound message with packet details below You can update outbound messages with the length of the remaining data for delimited records. To include this information in outbound messages (that is, when publishing), select the Update outbound message with packet details option.
    Fixed Length Select this option if the packets in the record are all the same length. Specify the number of characters in each packet.
    Token Select this option if the packets are separated by tokens. Specify one or more characters for the token.
    Offset Select this option if the packet length is determined by an offset. Specify the number of characters in the offset.
    Prefix Select this option if the length of the packets is contained in a Prefix. The following additional information is required:
    Size
    The length of the packet.
    Format
    The packet can be in ASCII or Bytes (EBCDIC) format.
    Swap Bytes
    Select this option if the transport swaps the order of the bytes before it treats the data as the length of the record.
    Length includes prefix
    Select this option if the length in the Size field includes the length of the prefix.
    Propagate prefix
    Select this option if you want to write the prefix to the outgoing message.
    For Delimited type records, see the following table:
    Table 3. Fields for Delimited type records
    Field Description
    Update outbound message with packet details below You can update outbound messages with the length of the remaining data for delimited records. To include this information in outbound messages (that is, when publishing), select the Update outbound message with packet details option.
    Start Token Specify one or more characters for the token that begins a record.
    End Token Specify one or more characters for the token that ends a record.
    For ISO 8583 type records, see the following table:
    Table 4. Fields for ISO 8583 type records
    Field Description
    Update outbound message with packet details below You can update outbound messages with the length of the remaining data for delimited records. To include this information in outbound messages (that is, when publishing), select the Update outbound message with packet details option.
    Select the ISO 8583 Schema Select a Data Format Description Language schema that you have previously uploaded to the Schema Library.
    For Token delimited records, see the following table:
    Table 5. Fields for token-delimited records
    Field Description
    Update outbound message with packet details below You can update outbound messages with the length of the remaining data for delimited records. To include this information in outbound messages (that is, when publishing), select the Update outbound message with packet details option.
    Start Token Specify one or more characters for the token that begins a record.
    End Token Specify one or more characters for the token that ends a record.
    End Token Data Length The number of characters of data that can follow the end token.
    For Dynamic type records, see the following table:
    Table 6. Fields for dynamic type records
    Field Description
    Update outbound message with packet details below You can update outbound messages with the length of the remaining data for delimited records. To include this information in outbound messages (that is, when publishing), select the Update outbound message with packet details option.
    Remove newline character from the end of each record Select a Data Format Description Language schema that you have previously uploaded to the Schema Library.

Feedback