Tutorial: SQL CLR Stored Procedures - Call a Stored Procedure Defined in an SPD File using Group Variables

This tutorial walks you through the process of modifying the SQLCLRTutorialSPCall solution to call a stored procedure using group variables.

You can pass group structured host variables to a SQL CLR stored procedure, receiving results as a group variable. The modifications to made in this tutorial to the SQLCLRTutorialSPCall solution demonstrate how to use group variables as parameters when working with stored procedures.

Requirements

In addition to the tutorials specified in the Prerequisites topic, you must also complete Tutorial: SQL CLR Stored Procedures - Call a Stored Procedure using an SPD File.

Modify the SQLCLRTutorialSPCall Solution

  1. If you have closed the SQLCLRTutorialSPCall solution, open it in Enterprise Developer.
  2. From the Solution Explorer, replace the SPCall.cbl file in the SPCall project with the SPCall.cbl file located in the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\SQL\hcoss\JCLCallingSP\SPDGroupDemo\SPCall directory.
  3. Replace the EMP.cpy, GETHIRE.cbl, and SQLCLRStoredProc.spd files in the SQLCLRTutorial project with files of the same names, located in the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\SQL\hcoss\JCLCallingSP\SPDGroupDemo\ SQLCLRTutorial\SQLCLRTutorial directory.

Rebuild the Solution

  • From the Solution Explorer, right-click the SQLCLRTutorialSPCall solution; then click Rebuild Solution from the context menu.

Republish the SQLCLRTutorial.Publish Project

  • Right-click the SQLCLRTutorial.Publish project; then select Publish from the context menu.

Restart the JCLSP Enterprise Server Region

  • On the Server Explorer, right-click the JCLSP region; then select Restart from the context menu.

Submit the JCL

  • From the Solution Explorer, right-click SPCall.jcl; then select Submit JCL from the context menu.

View JCL Execution Results

  1. In the Enterprise Developer Output window, select Enterprise Server from the Show output from drop-down list.
  2. CTRL-click the job output link.

    This opens the JCLSP tab, showing the Enterprise Server Job Output window.

  3. Click SYSOUT.

    This shows the output from the SQL CLR Stored Procedure.

  4. Close the JCLSP tab.

Stop the JCLSP Enterprise Server Region

  • On the Server Explorer, right-click JCLSP; then select Stop from the context menu.