Dynamic call to Datacom SQL Subprogram from Main Program without SQL
search cancel

Dynamic call to Datacom SQL Subprogram from Main Program without SQL

book

Article ID: 385441

calendar_today

Updated On:

Products

Datacom

Issue/Introduction

This article explains how a COBOL batch main program without any Datacom SQL can call a COBOL subprogram executing Datacom SQL calls dynamically.

Environment

z/OS

Datacom SQL  batch-only. 

Resolution

For the main program , use COBOL compiler option NODYNAM. Then link-edit as usual so with INCLUDE DBSU1PR , INCLUDE DBXHVPR, ENTRY BEGIN  and code  ENTRY 'DBMSCBL'   in the main program source .  

Then for PGMSUB  with SQL calls ,  use the Cobol compiler option DYNAM . Do NOT  use the INCLUDE for DBSU1PR nor DBXHVPR and use ENTRY  PGMSUB  . 

Additional Information

Note that the SQL Precompiler option USRNTRY for PGMSUB should be NONE.