Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Getting 822 Sql code while executing COBOL-DB2 program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rajat_gupta

New User


Joined: 05 Apr 2007
Posts: 15
Location: india

PostPosted: Wed Jun 06, 2007 6:24 pm    Post subject: Getting 822 Sql code while executing COBOL-DB2 program
Reply with quote

Hi all
I have a Cobol-DB2 program. I have done Bind package and Bind plan .but when I am running the program I am getting U00000 Abend and SQL return code 822 which is due to different timestamps in load module and plan name.but after compilation of the program I have done the proper bind package and bind plan.
I dont know whether I need to give the application plan name or not.
if yes then where to give (in COBOL or in JCL). and by which name (whether it will be the same name as plan which i have created).
Can anyone pls help me out of this situation and provide me input on this.

Thanks
Back to top
View user's profile Send private message

socker_dad

Active User


Joined: 05 Dec 2006
Posts: 147
Location: Columbia, MO

PostPosted: Wed Jun 06, 2007 9:32 pm    Post subject: Re: Getting 822 Sql code while executing COBOL-DB2 program
Reply with quote

I hate to say this because it sounds like such a cop out, but talk to your senior programmers. The exact libraries are usually site-dependant and while we may offer opinions and suggestions, only they know exactly where the stuff is stored.

icon_wink.gif
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Thu Jun 07, 2007 1:05 am    Post subject:
Reply with quote

Do you mean -822?
Back to top
View user's profile Send private message
rajat_gupta

New User


Joined: 05 Apr 2007
Posts: 15
Location: india

PostPosted: Thu Jun 07, 2007 9:17 am    Post subject:
Reply with quote

YES Murphy its -822
Back to top
View user's profile Send private message
raviprasath_kp
Warnings : 1

New User


Joined: 20 Feb 2005
Posts: 65
Location: chennai

PostPosted: Thu Jun 07, 2007 9:50 am    Post subject:
Reply with quote

sqlda contains invalid data or address check the data and adress properly
Back to top
View user's profile Send private message
rashmirr

New User


Joined: 18 Aug 2005
Posts: 1

PostPosted: Thu Jun 07, 2007 11:42 am    Post subject:
Reply with quote

Hi,
If you go for the exact definition of -822 then it is given below:

-822 THE SQLDA CONTAINS AN INVALID DATA ADDRESS OR INDICATOR VARIABLE
ADDRESS

Explanation: The application program has placed an invalid address in the
SQLDA.

System Action: The statement cannot be executed.

Programmer Response: Correct the application program such that valid
addresses are placed in SQLDA.

Please check your program where you are getting this error.
Thanks
Rashmi
Back to top
View user's profile Send private message
bansal

New User


Joined: 03 Jan 2007
Posts: 27
Location: Hyderabad

PostPosted: Thu Jun 07, 2007 12:17 pm    Post subject: Re: Getting 822 Sql code while executing COBOL-DB2 program
Reply with quote

Hi,

Timestamp mismatch between load and bind would result in -818 error..

But -822 error is related to SQLDA

THE SQLDA CONTAINS AN INVALID DATA ADDRESS OR INDICATOR VARIABLE ADDRESS
Back to top
View user's profile Send private message
priyamnavada

New User


Joined: 24 Dec 2005
Posts: 52
Location: hyderabad

PostPosted: Thu Jun 07, 2007 3:57 pm    Post subject:
Reply with quote

-822 THE SQLDA CONTAINS AN INVALID DATA ADDRESS OR INDICATOR VARIABLE
ADDRESS

Explanation: The application program has placed an invalid address in the
SQLDA.

System Action: The statement cannot be executed.

Programmer Response: Correct the application program such that valid
addresses are placed in SQLDA.
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Thu Jun 07, 2007 11:29 pm    Post subject:
Reply with quote

Rajat,

Is your -822 the first SQL that your program attempts to execute? Or are you able to execute other SQLs successfully before the failure?

Does your program use any exotic SQL statements such as DESCRIBE?

Are any of your host variables located in LINKAGE? This is a no-no. This can lead to bad pointers if you have more than 1 caller.

If any of your host variables live in LINKAGE, modify your program so that they all live in WORKING STORAGE. Move the values from LINKAGE to WS and make sure none of your SQLs refer to LINKAGE. ( Now there are situations where LINKAGE host variables will work - BUT unless you understand the details it is safer to always locate them in WS. If you want the details, just ask... ) We never use LINKAGE host variables.

Are there any COBOL tables in your working storage? Is it possible that the logic is overflowing these tables and trashing the variables that get generated by the DB2 precompiler?

Before you execute your SQL try doing this as an experiment.

PERFORM SQL-INITIAL

This paragraph is generated by the DB2 pre-compiler and it initializes the SQLDA variables - part of this initialization is to populate pointer addresses so that DB2 knows where your host variables are. Does this fix the problem?

If it does fix the problem then this indicates either 1) your SQLDA variables are getting trashed or 2) that your host variables are located in LINKAGE.

This PERFORM is not a solution - just a diagnostic step to determine whether your storage is getting trashed. If it fixes your problem you must then remove the PERFORM and hunt down where the trashing is happening.
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Wed Jun 13, 2007 11:45 pm    Post subject:
Reply with quote

Rajat,

If you are still watching this site, please tell us the outcome of your problem. I am curious...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us