Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Less overhead calling stored procedures (on z)?

Status
Not open for further replies.

Truusvlugindewind

Programmer
Jun 5, 2002
350
NL
I'd like to launch an idea of mine:

nowadays I'm coding COBOL stored procedures which are being called from WebSphere/java, other cobol programs and other cobol stored procedures.

It seems to me that cobol calling cobol by means of DB2/WLM generates a lot of overhead. But sometimes, when generating a result-set as output, it is mandatory.
But, when the output is represented as parameters, you might call the procudure the oldfashioned COBOL-way.

The company I work for is not open for that discussion right now. So, modest as ever, I want to discuss this with you: the rest of the world :)

There are a lot of issues with compile/link/bind described here: Suppose you've read it all and managed to compile/link/bind your stored procedures to enable both DB2 and COBOL calls.

Then you could call your procudures/modules like this
Code:
900-CALL-STORED-PROC ECTION.                                
900-10.                                                     
    EXEC SQL
      SELECT  LANGUAGE ,  EXTERNAL_NAME  ,  RESULT_SETS
        INTO :LANGUAGE , :EXTERNAL-NAME  , :RESULT-SETS
        FROM  SYSIBM.SYSROUTINES
        WHERE OWNER         = 'S'
          AND ROUTINE_TYPE  = 'S'
          AND CREATED_BY    = 'S'
          AND NAME          = 'ABC'
    END-EXEC.
    IF  LANGUAGE    = 'COBOL'
    AND RESULT-SETS = ZERO
    THEN CALL EXTERNAL-NAME USING W-PARM01,
                                  W-PARM02,
                                  W-PARM-NULLS
               
         END-CALL
    ELSE EXEC SQL
             CALL 'S.ABC'      ( :W-PARM01 :W-PARM01-NULL
                               , :W-PARM02 :W-PARM02-NULL  )
         END-EXEC
         IF SQLCODE = +466
         THEN PERFORM ASSOCIATE-ALLOCATE-FETCH-CLOSE-ABC
         END-IF
    END-IF.
900-090.
    EXIT
This is a theory and the code should be read as 'pseudo-code'.
Is there anybody out there who is able to test this. Tell me if it works and give some performance figures?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top