Previous Topic Next topic Print topic


COBOL Wrapper Programs

In the past, stored procedures originally written for DB2 mainframe applications could not be accessed as SQL CLR stored procedures running on SQL Server. To use a stored procedure that originated in DB2 required that you manually convert the DB2 code to Microsoft SQL Server standards.

To get around this requirement, we provide the SPD File Code Generator tool. This tool generates a COBOL wrapper program from a stored procedure definition (SPD) file. The generated program contains SQL CLR APIs, calls the original DB2-style COBOL stored procedure routine, and returns the information from the call to SQL Server. The benefits of generating a COBOL wrapper program for your DB2-style stored procedure are:
  • You are not required to manually convert the code.
  • The COBOL wrapper program converts the .NET variables required by SQL CLR stored procedures to standard COBOL host variables.
  • You can pass COBOL group variable names by defining parameters as BINARY or VARBINARY in the SPD file and use the BINARY or VARBINARY SQL Type in the client stored procedure code instead of PIC X COBOL variables.

The SPD File Code Generator tool takes an SPD file as input and requires that a corresponding COBOL skeleton program be present in the project. For information on creating and adding SPD files to your project, see To create a stored procedure definition (SPD) file.

Previous Topic Next topic Print topic