What steps should I take to execute a normal COBOL program with no DB2 statements and with a Sub-program containing DB2 statements. If u have any reference documents regarding this please send me that too.
If you want to execute a program [I call TESTABC] with the following criteria:
1) It has no embedded SQL
2) It has a dynamic call to a program containing SQL statements
In the above scenario,you do not need to bind your pgm TESTABC.
A normal compilation of the program will do..
If you have a static call inside ur pgm to a prgm containing SQL ,then
you will have to follow follwing steps:
note : IF it is a CICS COBOL DB@ pgm,it needs to be translated before
the below steps
1) Precompile ur program TESTABC [This seperates SQL from ur pgm]
2) Bind the DBRM to make an aplication plan or a package
3) compile your program
Plz lemme know if you need further details...
Deepak
In the run jcl SYSTSIN card if i specify DSN(TESTABC) PLAN(P1) and
the sub program(this has embedded SQL) is bound with plan P1. Then How does DB2 work in this case?
Since there is no package exists in the name TESTABC, DB2 should return with bad SQLCODE right?
As per my understanding,your program TESTABC is making a call to a subprogram and doing some business level processing using COBOL and with the data returned by subprogram..
When there is no SQL in your code,why do you need DB2 access ??
Your subprogram would already be bound and it would take care of
DB2 access.
1. I precompiled, compiled and bounded by sub-program (SUBPROG) with DB2 statements.
2. I compiled the main program (TESTABC) which calls SUBPROG dynamically.
3. Now in the execution JCL, I will IKJEFT1B whic we use to Execute JCLs normal DB2 programs.
4. In the SYSTSIN parameter, I'll specify the following
DSNECP00 SYSTEM(DB2)
RUN PROGRAM(TESTABC) PLAN(STPBSHRP)
END
*STBSHRP has the package which contains the SUBPROG in its PKLIST.
You do not need to do this:
DSNECP00 SYSTEM(DB2)
RUN PROGRAM(TESTABC) PLAN(STPBSHRP)
END
You can take out this step in the JCL.
You can take a sample compile JCL to compile a normal COBOL program from this site.
You can see a JCL link top frame on this site..
Since your program is not directly accessing DB2,you would need a
JCL to compile a plain COBOL program ,change the loadlib accordingly and use it.