Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    1

    Unanswered: DB2 query in a sub-program

    Hi,

    I need to know the performance for the below two cases.

    1. I will embed all my DB2 queries in a COBOL program.

    2. I will write a cobol sub-program which will have a DB2 query. Whenever I need to query I will call this cobol sub-program from the main COBOL program.

    The second option will provide me more modularity. But which is more efficient? What will be the effects on performance. Performance is a key factor in deciding the choice.

    Pls provide your suggestions.

    Thanks,
    Dilip

  2. #2
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    Quote Originally Posted by iamdilip
    I need to know the performance for the below two cases.
    1. I will embed all my DB2 queries in a COBOL program.
    2. I will write a cobol sub-program which will have a DB2 query. Whenever I need to query I will call this cobol sub-program from the main COBOL program.
    There is of course a certain overhead for a (COBOL) program to call a subprogram. Apart from that, seen from DB2, there is no performance difference.

    If you really want maximal performance and still modularity, write the subprogram as a paragraph or section in your main program and replace CALL by PERFORM. That's exactly the strength of COBOL as compared to other programming languages: it avoids call stack build-up and still has a modular program structure. Down side are the global variables... (You can't have it all ;-)
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

  3. #3
    Join Date
    Oct 2008
    Location
    Vienna, VA
    Posts
    5
    Very good suggestion there. Glad to know lots of people are still trying to dig up some Cobol routines here and there these days.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •