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

How i see the SQLCA contents after excution of program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sunil_chappy

New User


Joined: 19 Mar 2006
Posts: 9
Location: Bangalore, INDIA

PostPosted: Sat Apr 15, 2006 2:16 pm
Reply with quote

HI,
In COBOL-DB2 program my SQL taking too much time.......please tell me how i know whts the reason for that and how i solve that problem.

2. How i see the SQLCA contents after excution of program.
Back to top
View user's profile Send private message
Jag

New User


Joined: 07 Dec 2005
Posts: 30
Location: India

PostPosted: Sun Apr 16, 2006 1:23 pm
Reply with quote

Hi...


The main reason for taking much time for running query may be you have n't used the Indexes in the Where clause of the query.Or you query may really fetching more data...

Coming to next question..Are you using the query in the application program or SPUFI..If yo are using spufi you will get the SQLCODE and SQLSTATE and stuff of the execution irrespective of whether the query has been exexuted Sucessfully or nor..If you are using the query in the Application program then while handing the error you give the display statement for the SQLCA parameters which you can see in the output..

I hope i cleared your doubvt
Back to top
View user's profile Send private message
r2k1984

New User


Joined: 21 Jun 2005
Posts: 69
Location: chennai

PostPosted: Mon Apr 17, 2006 5:07 pm
Reply with quote

ur query is not a optimised query.when u are using a big database try to use sub queries or groupb and having cammands.
Back to top
View user's profile Send private message
mann_naaz

New User


Joined: 13 Dec 2006
Posts: 4
Location: Pune

PostPosted: Wed Jan 10, 2007 11:16 am
Reply with quote

I M GETTING SQLCODE AND SQLSTATE IN SPOOL BUT IN HEXADECIMAL FORMAT

HOW TO GET IN DECIMAL FORMAT
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Wed Jan 10, 2007 2:22 pm
Reply with quote

HI Mann_naaz tyhe PIC of sqlcode is comp-4 so if u print the same it would be in hex format try this one

01 ws-sqlerr pic -9(3).

Move sqlcode to ws-sqlerr.

Display ws-sqlerr

and reg SQLSTATE it is X95) in picture clause so u can display it directly

Cheer's,

Thamilzan.
Back to top
View user's profile Send private message
mann_naaz

New User


Joined: 13 Dec 2006
Posts: 4
Location: Pune

PostPosted: Wed Jan 10, 2007 7:19 pm
Reply with quote

THANKZ THAMILZN
I HAVE APPLIED IT AND IT IS WORKING. icon_smile.gif
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Thu Jan 11, 2007 7:12 pm
Reply with quote

Hi,


mann_naaz wrote:

I M GETTING SQLCODE AND SQLSTATE IN SPOOL BUT IN HEXADECIMAL FORMAT
HOW TO GET IN DECIMAL FORMAT


SQLCODE is always hexadecimal.
If you want to display as a decimal you can do it by programing as explained by prav_06, But if the client doent require in reporting it is not that requried to program to know it ( As it will take extra code and space)

For this issue this command in the spool

Code:

SET HEX ON


This make spool be displayed in hexadecimal to decimal and you can know the Equivalent
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top