I am trying to call a DB2 stored procedure from a cobol program. Up to this point, I have been calling them from ASP pages. I want to get this to work so that the host programmers can test the stored procedures on their own, in an environment thats comfortable.
I have found the correct syntax to make the call withing my cobol program.
Code:
EXEC SQL
CALL M7476M94(:SEND-RECORD-TYPE-ID,
:SEND-VER-ID,
:RTN-PROCESSING-DATE,
:RTN-DAILY-CYCLE-STS-CD
:RTN-RETURN-CODE)
END-EXEC.
My cobol calling program (M747TEST) compiles fine. Next step is to bind it. Here is where the trouble starts. Here is my jcl.
Code:
//STEP01 EXEC PGM=IKJEFT01
//STEPLIB DD DSN=DB2VST.DSNLOAD,DISP=SHR
//DBRMLIB DD DSN=ENDH1.B02CL003.SBATDBRM,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//ABENDAID DD SYSOUT=*
//SYSUDUMP DD SYSOUT=D
//SYSTSIN DD *
DSN SYSTEM(TDH1) RETRY(5)
BIND PACKAGE(C2323LOSSDBT) -
MEMBER(M747TEST) -
EXPLAIN(NO) -
ACTION(REPLACE) -
OWNER(TD7476ST) -
VALIDATE(BIND) -
ISOLATION(CS) -
FLAG(I)
END
/*
//
We keep our stored procedures in a product called Endevor. I am a new programmer, and have only worked in 1 company so I'm not sure how common this is. It is basically a mainframe source code management system. It is made up of several stages, the highest (stage 6)being production, the lower ones being test.
In my bind, if the stored procedure is in stage 6, the bind works fine. I can run the calling program and everything works. However, if the stored procedure is not in stage 6, which will always be the case since we are testing it, then i get a bind error -440. Cannot find program.
So I started looking at the JCL for the bind. And I now wonder how it knows where to look for the stored procedure. I dont see anything pointing to specific libraries. But it is like it is defaulting to our stage 6 (production) libraries.
Does that make sense to anyone? I would like to be able to point it to the right libraries so it can find stored procedures that are lower in the Endevor food chain and bind correctly.
Thanks.