473,791 Members | 3,179 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 22469
"Zalek Bloom" <za********@hot mail.com> wrote in message
news:e8******** *************** ***@posting.goo gle.com...
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=yo ur.DB2.load.lib
//SYSTSIN DD *
DSN SYS(db2 subsystem name)
RUN PROGRAM(PROG1) LIB(your.applic ation.load.lib) PLAN(your plan name)
PARM(if required)
END

Nov 12 '05 #2
za********@hotm ail.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,PA RM='%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
5129
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 appreciated. My main issue is with the CALL routine - I have to call a external function which I believe is Assembly. Right now the call is made using 4 structures in COBOL. To convert to C++ - what should I be concerned about, should I pass 4...
4
25706
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: WHERE DSNAME LIKE 'ABC%' Example that does not work:
1
2141
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 using AQT and dynamic queries. just prepend the schema name, and let er rip. big deal. then my cobol colleagues started with: plans, packages, collection ids. my eyes began to glaze over. so, is it just some straightforward configuration...
5
2720
by: hpy_awad | last post by:
can cobol read binary data written by fprintf (C function) ?
2
1434
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! **************************************************************************************************** Original Question: -------------------- Has anyone called a COBOL subroutine using COBOL CALL from a COBOL/DB2
7
13714
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 reinitialize the addresses and even more when it decides not to do it. Recently I've ben strucked with a problem of host variables defined in LINKAGE SECTION, and it took me some time to find the cause and solution for the problem.
0
5803
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 but when the calling program enters the SP, it either hangs or gives me sqlcode -1131. We are on AIX 5.2 (I think) running DB2 UDB ver 7.2 and MF COBOL 4.1. Below are the programs I wrote:
2
6416
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 can use either depending on which is more efficient. One of the older posts ("Calling a COBOL Subroutine from COBOL/DB2 Stored Procedure" Dec 2005) suggested this is possible but I couldn't follow the explanation and there wasn't any examples....
0
2076
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 program. Please help me in this regards.
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10201
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10147
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9987
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2910
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.