Bind the TwoPackageSet Program

Walks you through the steps required to build and bind the TwoPackageSet program, creating two packages and a plan.

Build the TwoPackageSet project

Based on the compiler directives set for the TwoPackageSet project, ED generates a DBRM as it compiles the program.

  • In the Solution Explorer, right-click the TwoPackageSet project, and then select Build from the context menu.

Bind the TwoPackageSet program

Here, you bind the compiled TwoPackageSet program to the DBRM generated when it was compiled. You do this using the HCOSS Manage Packages and Plans tool to create two packages and a plan. Each package you create is in its own collection and has a unique qualifier, but both point to the same source member and library. You then bind both packages into one plan.

Start HCO for SQL Server tools
  • In Visual Studio, click View > Micro Focus SQL Tools > HCO for SQL Server Tools.
Start the Manage Packages and Plans Tool
  1. From the HCO for SQL Server interface, click Manage Packages and Plans.
  2. From the SQL Server Connection drop-down list, select HCODemo.
Create two packages
  1. Click New Package. Then specify the following:
    Property Value
    Collection Name TEST
    Library Name <Default>
    Default Qualifier TEST
    Action Replace
  2. Click Execute. This creates the package in the database.
  3. Change the Collection Name to PROD and the Default Qualifier to PROD.
  4. Click Execute. This creates a second package.
  5. Switch to the Bind Scripts tab. Notice the BIND script commands that were created as a result of creating each package.
Bind the two packages into a plan
  1. Click New Plan.
  2. In the Plan Name field, type TWOPACKAGESET.
  3. On the Available Collections list, click PROD.
  4. On the Available Packages list, click TWOPACKAGESET.
  5. Click Add to add this package to the Selected Packages list.
  6. Repeat steps 3 through 5, substituting TEST instead of PROD, to add the TEST.TWOPACKAGESET package to the Selected Packages list.
  7. In the Action group, click Replace.
  8. Click Execute to add the BIND PLAN entry to the script and to also bind the plan.
Verify the results
  1. Using Microsoft SQL Server Management Studio, connect to your SQL Server instance.
  2. On the Object Explorer, expand Databases > HCO_Test > Programmability > Stored Procedures to see the stored procedures HCOSS created when you executed your packages and plan.
  3. Open one of the stored procedures that contains PKG as part of its name - right-click the procedure, and click Modify.

    In this, you see the SQL from your application code. You also see SQL Server function calls to UPPER. These were converted from DB2 function calls to UCASE. This is due to having set the SQL(DIALECT=MAINFRAME) directive when you compiled.