Applying PL/I source file schemas to messages

After you add a PL/I source file schema to Test Integrations and APIs, you can apply the schema to messages in applicable test actions.

About this task

The following example starts with a new project. For more information about messages, schemas, and validation, see API Tester Reference.

Procedure

  1. Create a PL/I source file, test.inc.
    dcl 1 message_body,
        2 field_type char(1),
        2 test_field char(10);
  2. Add a PL/I source file schema by using the PL/I source file. For more information, see Adding PL/I source file schemas.
  3. Create an empty test.
    1. In Architecture School create a service component - named SC1. Then, within SC1, create an IBM CICS region - named CR1.
    2. In Test Factory, under service component SC1, create a new test, named test1.
  4. Add a Send Request action to the Test Steps phase of the test. A Receive Reply action is also created automatically.
    Send request action
  5. Open the Send Request action for editing.
  6. For Transport, browse to CR1.
  7. For Message Type, Commarea is selected automatically.
    The Byte Array option is shown in the screen capture.
  8. Select the data row and double-click the Value column. Enter the following string: F1F0F0F0F0F0F0F0F0F2F3
    The data value in the screen capture is an EBCDIC string
    This string represents compressed data that has not yet been formatted by a PL/I source file schema.
  9. Right-click the data element and select Schema.
  10. In the Schema Selector window, Schema Type field, select Mainframe > PL/I and select the schema that you imported into the Test Integrations and APIs Schema Library.
  11. In the pane below the Schema Type, select a copybook and root.
    This example uses a PL/I source with a char(1) and a char(10) variable. A sample message is displayed.
  12. In the Formatter Properties section, select a value for the Encoding field.
    In this example, the default values are acceptable for the other fields.
  13. Accept the default values for the Content Options section and click OK.

Results

The schema is applied to the original message, expanding the data field as defined in the schema.
The data field is expanded.