Error Using Sql Host Variables In Linkage Section


Main Menu        Computer Tips        Software Downloads Menu

  Main Question - Posted From Guest:
We have a cobol program that calls a stored procedure, and that stored procedure calls a second stored procedure. This was never a problem as this has run in production for years (version 6 and 7 of DB2, now version 8 and 9 of DB2 are also used). We started getting unpredictable and wierd results returned from the SQL, no db2 error just wierd results returned when the sql query runs. We recently added the call to the second stored procedure. Is the problem in the host variables being used in the linkage section? I've never seen host variables in the linkage section like this, not sure why that would be coded that way to start.

Guest Says:
Yeah thats your problem. If you are calling one stored proc then you are fine, which is probably why it ran fine for years until you added the 2nd stored procedure. If you are doing sql in both and using the linkage section, it will be a disaster. You can reset the SQL-INIT-FLAG flag which should make it work. But why screw around with this? Get your host variables out of the linkage section and start using them in working storage. Don't put tape on a time bomb when you easily fix it so it won't go off again.

abc Says:
In cobol this can also happen when you are just calling programs also, it doesnt have to be stored procedures getting called, referencing the linkage section this way can cause problems with either cobol call or stored procedure call.


Add your reply below ...



This site allows you to ask questions and get answers from various posters, you may also answer any posts if you feel like you have input to give. Feel free to ask for help with any new question you wish, but most of the questions here are tech related. You will find many questions and answers related to your Ipod or Ipod Nano, Itunes, audio and video converting, spyware or adware cleanup, pc or other computer questions, and even mainframe questions. Although these are the tech questions most often asked, you will find help on almost any computer or software related subject. Feel free to go to the main menu and review the posts already present, or feel free to ask your own question. (Some questions will be closed once the moderator feels they are sufficiently answered and that no other input is needed).

Your Name:

Your Reply:

Type in verification code:


Main Menu

Shareware and Freeware Database

Tasks and Spyware Database

Various Computer Help Topics