Designing Metadata Artifacts for Host Files

This guide shows how to design metadata artifacts for host files. You can then save these metadata artifacts as Host Integration Server Definition XML (HIDX) files to use with the Host Files built-in, service provider-based connector in Azure Logic Apps.

Prerequisites

  • Download and install Visual Studio. After installation, make sure that you also install the workload named Desktop development with C++ in Visual Studio. Otherwise, you get the error Exception from HRESULT 0x800A007C.

  • Download and install the HIS Designer for Azure Logic Apps. The only prerequisite is Microsoft .NET Framework 4.8.

  • Enable Visual Studio support for the Flat File processor in Azure Logic Apps. For this task, follow these steps:

    1. Open Visual Studio. On the toolbar, open the Tools menu, and select Options.

    2. From the Options list, expand Host Integration Server, and select Host Files.

    3. On the Host Environment tab, select Include support for Flat File Processor and Logic Apps.

      Include support for Flat File Processor and Logic Apps dialog

Create a host file project

In Visual Studio, you can use the Host File project template to create metadata artifacts. You can then use these artifacts with the Host Files built-in, service provider-based connector in Standard workflows for Azure Logic Apps. To create a new host files project, follow these steps:

  1. In Visual Studio, from the File menu, select New > New Project.

  2. From the project template list, select Host File > Next.

  3. In the Configure your new project box, change the details that you want, and select Create.

    Screenshot shows Visual Studio and details for Configure your new project.

Add a host file definition

To support the Host Files connector in Azure Logic Apps, you need to add a host file definition.

  1. In Solution Explorer, open the new host file project's shortcut menu, and select Add > Add Host File Definition.

  2. When the Add New Item box appears, in the Name property, provide a name for the host file definition, and select Add.

    These steps continue with the example name HostFileDefinition1.

  3. After the Host File definition wizard launches, in the Host Environment box, select the Host Environment and the Host Language, based on the following table:

    Host Environment Host Language
    Host File for System z (z series IBM mainframe systems) COBOL
    Host File for System i (i Series IBM midrange systems) COBOL or RPG
  4. When you're done, select Create.

After you finish with the wizard, the main design view appears for you to manually create or import metadata artifacts. For this task, continue to the next section.

Design a metadata artifact

This section shows how to manually create a metadata artifact. To import a host definition instead, see Importing Host Definitions.

The following table lists the components of the main design view:

Component Description
Tables folder Tables define the mapping between a host file and a schema. The Tables folder groups data tables in the assembly.
Schemas folder Schemas define the mapping between the host file record fields and the .NET data types. The Schemas folder groups variables with shared attributes.
Unions folder Unions can apply sets of rules depending on their type. The Unions folder contains the equivalents of COBOL unions.

Add a table

  1. In the main design view, open the Tables shortcut menu, and select Add Table.

    Screenshot shows main design view, Tables shortcut menu, and selected option for Add Table.

  2. Open the new table's shortcut menu, and select Properties. Provide values for each column's properties based on the following table:

    Property Description or value
    Alias A valid alias that starts with [A-Za-z], followed by alphanumeric characters with a maximum length of 256, for example, CUSTOMER
    Host File Name A mainframe file name has up to 22 parts separated by a period (.). Each part is limited to 10 characters. The maximum total size is 44 characters, for example, HISDEMO.NWIND.CUSTOMER
    Schema Represents the structure of the host file, including data types.

    Screenshot shows new table and properties.

Add a schema

  1. In the main design view, open the Schemas shortcut menu, and select Add Schema.

    Screenshot shows main design view, Schemas shortcut menu, and selected option for Add Schema.

    The designer creates a schema with one field.

  2. To add another field, open the new schema's shortcut menu, and select Add Field. Repeat this step as necessary.

  3. Open the new field's shortcut menu, and select Properties. Provide values for each field's properties based on the following table:

    Property Description or value
    Is Array If true, you must set the array dimensions, which support arrays with up to 7 dimensions and 16,777,215 elements. You must also enter values for the array properties Occurs Count In and Occurs Depending On.
    Data Type The field's .NET data type
    Name The field's name of the field
    Error Handling Trigger an error, round, or truncate.
    Host Data Type The field's COBOL or RPG data type
    Size A 32-bit integer
    String Delimiting Null Terminated or Space Padded
    Trailing Filler For fields where the length is less than the specified maximum, you must specify the filler size.

    Screenshot shows new field and properties.

Add a union

  1. In the main design view, open the Unions shortcut menu, and select Add Union.

    Screenshot shows main design view, Unions shortcut menu, and selected option for Add Union.

    The designer creates a union with two members.

  2. To add another member, open the new union's shortcut menu, and select Add Union Member. Repeat this step as necessary.

  3. Open the member's shortcut menu, and select Properties. Provide values for each member's properties based on the following table:

    Property Description or value
    Is Array If true, you must set the array dimensions, which support arrays with up to 7 dimensions and 16,777,215 elements. You must also enter values for the array properties Occurs Count In and Occurs Depending On.
    Data Type The member's .NET data type. This value can include structures defined in the previous section.
    Name The member's name
    Error Handling Trigger an error, round, or truncate.
    Host Data Type The member's COBOL or RPG data type
    Size A 32-bit integer
    String Delimiting Null Terminated or Space Padded
    Trailing Filler For members where the length is less than the specified maximum, you must specify the filler size.

    Screenshot shows new union member and properties.

  4. When you're done, continue to the next section to create the library that stores the metadata's design.

Create the Host Integration Definition XML (HIDX) or metadata artifact

This section describes how to create the library that stores the metadata artifact's design.

  1. To generate the metadata artifact, on the Visual Studio File menu or toolbar, select Save All. (Keyboard: Press Ctrl+Shift+S)

    Screenshot shows Visual Studio toolbar with selection option for Save All.

  2. To find the generated HIDX file, go to your host file's folder.

    Screenshot shows Visual Studio Output window with HIDX file location.