Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Steps to Bind a calling COBOL program with no DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ajay_dheepak

New User


Joined: 12 May 2005
Posts: 32
Location: Chennai

PostPosted: Wed Sep 14, 2005 12:29 pm    Post subject: Steps to Bind a calling COBOL program with no DB2
Reply with quote

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
View user's profile Send private message

itzDeepak

New User


Joined: 06 Sep 2005
Posts: 12

PostPosted: Wed Sep 14, 2005 5:08 pm    Post subject: Re: Steps to Bind a calling COBOL program with no DB2
Reply with quote

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
View user's profile Send private message
ajay_dheepak

New User


Joined: 12 May 2005
Posts: 32
Location: Chennai

PostPosted: Wed Sep 14, 2005 5:21 pm    Post subject:
Reply with quote

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
View user's profile Send private message
itzDeepak

New User


Joined: 06 Sep 2005
Posts: 12

PostPosted: Wed Sep 14, 2005 5:50 pm    Post subject: Re: Steps to Bind a calling COBOL program with no DB2
Reply with quote

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
View user's profile Send private message
ajay_dheepak

New User


Joined: 12 May 2005
Posts: 32
Location: Chennai

PostPosted: Wed Sep 14, 2005 6:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
itzDeepak

New User


Joined: 06 Sep 2005
Posts: 12

PostPosted: Wed Sep 14, 2005 6:44 pm    Post subject: Re: Steps to Bind a calling COBOL program with no DB2
Reply with quote

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
View user's profile Send private message
itzDeepak

New User


Joined: 06 Sep 2005
Posts: 12

PostPosted: Wed Sep 14, 2005 6:51 pm    Post subject: Re: Steps to Bind a calling COBOL program with no DB2
Reply with quote

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
View user's profile Send private message
ajay_dheepak

New User


Joined: 12 May 2005
Posts: 32
Location: Chennai

PostPosted: Wed Sep 14, 2005 6:59 pm    Post subject: Re: Steps to Bind a calling COBOL program with no DB2
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us