MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Query Problem in accessing Database

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
vijayakumar
Beginner


Joined: 28 Jul 2006
Posts: 17
Topics: 9

PostPosted: Wed Oct 25, 2006 8:03 am    Post subject: Query Problem in accessing Database Reply with quote

Hi

I am getting efficiency problem while running this db2 query in cobol program it takes more time to run. This query will fetch the columns based on the matching keys present in the table and file.

In the table the key is INTEGER and in the file the key is defined as s9(15) comp-3.
Code:

 EXEC SQL
    SELECT 
           DATE_OF_BIRTH
           FIRSTNAME
           SURNAME
           into hostvariables
FROM  table name
WHERE table-KEY = :W00-file-KEY
with UR

In the table the Integer key(INDEX) field contains 10 digits and i tried to move s9(15) comp-3 to s9(9) comp and it causes truncation of digits.

Is there any other solution to overcome this problem.

Regards
vijay
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Oct 25, 2006 8:25 am    Post subject: Reply with quote

vijayakumar,

Define a working storage fiels Ws-file-KEY as

Code:

WS-file-KEY     PIC 9(18)


and move the s9(15) comp-3 variable to WS-file-key

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group