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
 

 

DB2 call vs cobol internal table processing performance

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

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Wed Dec 07, 2011 5:26 am    Post subject: DB2 call vs cobol internal table processing performance
Reply with quote

Hi All,

I have a table with some data and I want to make use of the data from the table in my cobol program. Just wanted to know performance wise which would be better. Could you please advise?

1) For each input record, making a DB2 call and querying the table and processing in the program. Lets says my input has 100 records, so there would be 100 DB2 calls to fetch the contents from the table and process it further in the program

2) Fetch the table contents using a cursor and load into a cobol internal table first. And for each input record, search the cobol internal table and further process it in the program. Here the 100 calls are being reduced to only 1 call by cusrsor but again the internal table has to be searched for 1000 input records.

Which is better performance wise? I don't have time to check the performance because any approach I opt for, I will continue with that as there is a time constraint. So just wanted to seek your suggestions.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Dec 07, 2011 6:00 am    Post subject: Reply to: DB2 call vs cobol internal table processing perfor
Reply with quote

I'd go for understandability and maintainability. Accessing the data as you need it is much more flexible. If you are storing data in a Cobol table, there is always some limit you have to impose - and then what.

Unless you have enormous amounts of data, I don't think you should worry about the performance of one method over the other.

If you do have enormous amounts of data - you have to make the time to do the analysis, at tne end of the day you have to "mock-up" both methods with reasonable volumes and under your site/systme-specific situation.

If you make the program(s) easy to understand and change then your support/maintenance people will thank you for it. Well, probably not in so many words, but they'll prefer changes to your programs over some other piece of rubbish which uses "cool" techniques, probably wrongly, and which takes five times the amount of effort to change and test and delays production for four hours when it abends (which is three or four times a year).
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 110
Location: Puerto Rico

PostPosted: Wed Dec 07, 2011 7:35 pm    Post subject:
Reply with quote

Good day to all!

First, I agree with Bill but your concern is performance. If you could do multi-fetch rows with the your version of DB2. Then option 1 with mult-fetch rows will be the best. Google for DB2 multi-fetch rows. Otherwise I will have to go with option number 2.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Wed Dec 07, 2011 10:01 pm    Post subject: Reply to: DB2 call vs cobol internal table processing perfor
Reply with quote

Here are a few points to consider:
  1. The size of your input and the size of your table are important criteria:
    If you have a small input and a large table, it will most certainly not be worth.
    On the contrary, if you have a very large input and a small table, it may be well worth.

  2. As Bill said, Cobol tables are limited in size and this might be a problem.

  3. Do you know which percentage of the table will be actually used?

  4. Another thing to determine is the number of time the same row will be fetched from the table.
    Can you sort your input file on the field used for DB2 select, and actually do a SELECT only when the value changes?
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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


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