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
 

 

How i see the SQLCA contents after excution of program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How i see the SQLCA contents after excution of program
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Re: How i see the SQLCA contents after excution of program
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    Post subject: Re: How i see the SQLCA contents after excution of program
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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 Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


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