473,394 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Can a COBOL batch program CALL to COBOL batch db2 program?

Actually I would like to know what additional JCL I will need if a
COBOL non-DB2 program is calling to a COBOL/DB2 program. The original
non-DB2 program is executed using:
//STEP1 EXEC PGM=PROG1

I know I have to supply database name/plan to my program, but how?

Another question: what happens is the PROG1 program is a DB2 program
and is calling to another DB2 program with a different database and a
different plan?
What kind of JCL I need then? Do I need a special BIND?

Thanks,

Zalek
Nov 12 '05 #1
2 22358
"Zalek Bloom" <za********@hotmail.com> wrote in message
news:e8**************************@posting.google.c om...
Actually I would like to know what additional JCL I will need if a
COBOL non-DB2 program is calling to a COBOL/DB2 program. The original
non-DB2 program is executed using:
//STEP1 EXEC PGM=PROG1

I know I have to supply database name/plan to my program, but how?

Another question: what happens is the PROG1 program is a DB2 program
and is calling to another DB2 program with a different database and a
different plan?
What kind of JCL I need then? Do I need a special BIND?

Thanks,

Zalek


If the DB2 program uses Call Attach, then you don't have to do anything to
your JCL. However, Call Attach programs are uncommon, so it is far more
likely that you will have to change your JCL to run PROG1 under TSO attach
via program IKJEFT01. The JCL would resemble something like:

//STEP1 EXEC PGM=IKJEFT01
//STEPLIB DD DISP=SHR,DSN=your.DB2.load.lib
//SYSTSIN DD *
DSN SYS(db2 subsystem name)
RUN PROGRAM(PROG1) LIB(your.application.load.lib) PLAN(your plan name)
PARM(if required)
END

Nov 12 '05 #2
za********@hotmail.com (Zalek Bloom) writes:
Actually I would like to know what additional JCL I will need if a
COBOL non-DB2 program is calling to a COBOL/DB2 program. The original
non-DB2 program is executed using:
//STEP1 EXEC PGM=PROG1

I know I have to supply database name/plan to my program, but how?


It doesn't really matter whether the calling or called COBOL program is the
one using DB2 - the critical point is establishing the connection to DB2.
And there's at least two ways to do this:

- The most common is to run the program under the control of tso batch,
using the DSN command. This means you will have to change your JCL to
run program IKJEFT01 instead of your application program's name, add some
extra DDs like SYSTSIN, and you'll also (assuming you use procs, which is
a fairly safe assumption) need to maintain a control card library
containing the invocation commands for your application program.
Alternatively, you could somewhat do away with that last part by writing a
generic CLIST/exec which would do the necessary allocations and
executions for you, and then you could put the program name into a parm,
something like this:

//CLIST EXEC PGM=IKJEFT01,PARM='%DB2ALC &DB2ID PROGRAM &PARMS'

DB2ALC would consist of a couple alloc statements and a DSN command.
pretty simple.

- The other, and I think superior, way to do it is by linking the call attach
facility into your code (module DSNALI). In that case, the JCL will stay
just like it is (with the possible exception of adding SDSNLOAD to your
steplib), and the connection will happen automatically, using a plan
name equal to the CSECT name first accessing DB2, and the database name
defined in the plan. If you don't have to do anything particularly fancy
to get a DB2 program to run, and you've standardized your plans to be
your program names (which is pretty sensible), I would go with this
method. *

P.S. If you're mixing, IMS with DB2, the CAF or TSO process isn't needed
at all, it's built into the IMS invocation. You could, if you were a
little wacky, do all your programs as IMS-controlled. There's even a
neat feature (the RTT) which would let you use any plan or package
that you like.
--
* PV something like badgers--something like lizards--and something
like corkscrews.
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kalpana Shridhar | last post by:
I am on a project where I am converting COBOL to C++ on the mainframe. I am new to COBOL and have a lot of questions - any websites or any suggestions from experienced people will be really...
4
by: Tom Walker | last post by:
I cannot get the WHERE statement to work correctly unless I use a literal with the LIKE. I want to use a working storage data name so that I can vary the WHERE statement. Example that works: ...
1
by: robert | last post by:
i may have been a bit glib in today's meeting. the issue of whether one could access tables from multiple schemas in a 390 instance came up. i piped up with, "easy". now, i was speaking from...
5
by: hpy_awad | last post by:
can cobol read binary data written by fprintf (C function) ?
2
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! ...
7
by: misha | last post by:
Hello. I was wandering if someone could explain to me (or point to some manual) the process of mapping the addresses of host variables by DB2. Especially I would like to know when DB2 decides to...
0
by: pompeyoc | last post by:
I am trying to learn how to use stored procedures written in COBOL so I wrote 2 small programs to test it out: the stored procedure and the the calling program. I have no problems compiling them...
2
by: pompeyoc | last post by:
Hi, I am a newbie when it comes to stored procs and i would like to learn how to call a COBOL program from a stored procedure. The SP can either be an DB2 SQL SP or an external COBOL/DB2 SP. I...
0
by: tgmgokul84 | last post by:
Hi, I just want to call a cobol sub program in my stored procedure. While i try to call the sub program i am getting the SQL code -927. The Cobol sub program is called by many other cobol...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.