|
View previous topic :: View next topic
|
| Author |
Message |
ajay_dheepak
New User

Joined: 12 May 2005 Posts: 32 Location: Chennai
|
|
|
|
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.
Thanks
-Ajay |
|
| Back to top |
|
 |
itzDeepak
New User
Joined: 06 Sep 2005 Posts: 12
|
|
|
|
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 |
|
| Back to top |
|
 |
ajay_dheepak
New User

Joined: 12 May 2005 Posts: 32 Location: Chennai
|
|
|
|
Thanks for the reply itzDeepak.
Now, I have a dynamic call in TESTABC...
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?
Thanks
Ajay |
|
| Back to top |
|
 |
itzDeepak
New User
Joined: 06 Sep 2005 Posts: 12
|
|
|
|
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. |
|
| Back to top |
|
 |
ajay_dheepak
New User

Joined: 12 May 2005 Posts: 32 Location: Chennai
|
|
|
|
I think i was not clear...
Just c this scenario
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.
When I do the above. will my program execut? |
|
| Back to top |
|
 |
itzDeepak
New User
Joined: 06 Sep 2005 Posts: 12
|
|
|
|
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. |
|
| Back to top |
|
 |
itzDeepak
New User
Joined: 06 Sep 2005 Posts: 12
|
|
|
|
You can use a JCL of this kind:
Change the Loadlibs and other PDS as per ur environment..
//XBX1120Z JOB (T,JTWC,JKSD0016),'COMPILE XBX1120Z',
// MSGCLASS=T,MSGLEVEL(1,1),NOTIFY=&SYSUID,TIME=1,
// LINES=9999
//*
//*********************************************************************
//*** PARTITIONED DATASET INPUT **
//*********************************************************************
//SRCECPY EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DSN= YOUR SOURCE WHERE U HAVE TESTABC
//SYSUT2 DD DSN=&&DSNOUT,DISP=(,PASS),
// UNIT=WORKDA,SPACE=(TRK,(2,10),RLSE)
//*********************************************************************
//*** VS COBOL II **
//*********************************************************************
//VSCOBII EXEC PGM=IGYCRCTL,COND=(4,LT),REGION=3M,
// PARM=('SSRANGE','SIZE(3072000)','XREF','LIST')
//STEPLIB DD DSN=SYS1.SIGYCOMP,DISP=SHR
//SYSLIB DD DSN=TXBX1.PRODFIX.COPYLIB,DISP=SHR,SUBSYS=LAM
// DD DSN=TXBEX.R000000.TEST.LC500.COPYLIB,DISP=SHR,SUBSYS=LAM
// DD DSN=CPYNS0EN.PROD.COPYCOB,DISP=SHR,SUBSYS=LAM
//SYSPRINT DD SYSOUT=*,
// DCB=(RECFM=FBA,LRECL=133,BLKSIZE=13300)
//SYSUT1 DD UNIT=WORKDA,SPACE=(TRK,(100,10))
//SYSUT2 DD UNIT=WORKDA,SPACE=(TRK,(100,10))
//SYSUT3 DD UNIT=WORKDA,SPACE=(TRK,(100,10))
//SYSUT4 DD UNIT=WORKDA,SPACE=(TRK,(100,10))
//SYSUT5 DD UNIT=WORKDA,SPACE=(TRK,(100,10))
//SYSUT6 DD UNIT=WORKDA,SPACE=(TRK,(100,10))
//SYSUT7 DD UNIT=WORKDA,SPACE=(TRK,(100,10))
//SYSLIN DD DSN=&&CBIIOUT,DCB=(RECFM=FB,LRECL=80,BLKSIZE=1680),
// DISP=(MOD,PASS),UNIT=WORKDA,SPACE=(80,(10000,10000))
//SYSIN DD DSN=&&DSNOUT,DISP=(OLD,PASS)
//*****************************************************************
//*** LINK EDIT SYSIN GENERATED **** DEFAULTS ****
//*****************************************************************
//LINKEDIT EXEC PGM=HEWL,REGION=1M,COND=(4,LT),
// PARM='MAP,LIST,XREF,REUS,AMODE=31,RMODE=ANY'
//SYSLIB DD DSN=TXCIC.BATAE.PGMLIB,DISP=SHR
// DD DSN=SYS1.SCEELKED,DISP=SHR
// DD DSN=CICS.CTS130.SDFHLOAD,DISP=SHR
// DD DSN=DSNDBL5.SDSNEXIT,DISP=SHR
// DD DSN=DSNDBL5.SDSNLOAD,DISP=SHR
//** DD DSN=BAMVS.FINALIST.CICSLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=&&SYSUT1,UNIT=WORKDA,DISP=(MOD,PASS),
// SPACE=(1024,(2000,200),,CONTIG,ROUND)
//SYSLMOD DD DSN=TXCIC.BATAE.PGMLIB,DISP=SHR
//SYSLIN DD DSN=&&CBIIOUT,DISP=(OLD,PASS)
// DD *
INCLUDE SYSLIB(DFHECI)
INCLUDE SYSLIB(DSNCLI)
ORDER DFHECI
ENTRY XBX1120Z
NAME XBX1120Z(R)
/* |
|
| Back to top |
|
 |
ajay_dheepak
New User

Joined: 12 May 2005 Posts: 32 Location: Chennai
|
|
|
|
Mr. Deepak,
I have been asking about the Execution JCL and not the Compile JCL.
The below code occurs in a SYTSIN card of a RUN JCL.
DSNECP00 SYSTEM(DB2)
RUN PROGRAM(TESTABC) PLAN(STPBSHRP)
END |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|