Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Location of DB2 Declarations in a Nested Program 1

Status
Not open for further replies.

rasETL

IS-IT--Management
May 28, 2003
213
US
Does anyone know where DB2 Table and Cursor Declarations need to be located for Sub-Programs in a Nested Program?

We ar running on IBM Z/OS. The Programs were separate sub-routines, but for efficiency purposes we would like to create a Nested Program. The hope is it will speed up the process since it needs to process 10.7 million records on a dialy basis.

The shop here likes to put DB2 Table and Cursor declarations in the Working-Storage Section.

When we simply nested the programs under the main program, the compiler sent error messages...

DSNH312I E DSNHSMUD UNDEFINED OR UNUSABLE HOST VARIABLE

This was for every statement attemting to use DB2 columns or cursors.

When we added Table and Cursor declarations to the main program, and left them in the sub-programs, the compiler
said there were duplicate declarations.

I'm not sure you can set DB2 Table and Cursor Declarations as Global Variables.(?)

Anyone have a clue???




 
You didn't tell us which compiler you are using - or whether you are using the "new" coprocessor or a precompiler step. However, at:


It says,

"Certain restrictions on the use of COBOL language that apply when you use the precompile step do not apply when you use the DB2 coprocessor:

- You can use SQL statements in any nested program. (With the precompiler, SQL statements are restricted to the outermost program.)"

which I *think* answers your quesiton.
 
WMK

Thanks for the info.

The errors are coming out of the DB2 SQL precompiler, so
the bookmark appears to relate to the issue.

Not sure where to go from here because I am not real familiar with DB2 inside COBOL, but others here are, so I can now approach them with some ammo.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top