IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Getting 822 Sql code while executing COBOL-DB2 program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 177
Location: Seattle, WA

PostPosted: Wed Jun 06, 2007 9:32 pm
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: 148
Location: Ottawa Canada

PostPosted: Thu Jun 07, 2007 1:05 am
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
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
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
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
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
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: 148
Location: Ottawa Canada

PostPosted: Thu Jun 07, 2007 11:29 pm
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: 148
Location: Ottawa Canada

PostPosted: Wed Jun 13, 2007 11:45 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts run rexx code with jcl CLIST & REXX 15
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top