Subtasking in ASSEMBLER is easily done using the MVS system macros
ATTACH, DETACH, WAIT, POST (Synchronization using ECBs). Maybe you know
about that.
For accessing DB2, I believe every parallel running subtask should build
its
own DB2 connection. Otherwise you will get calls to DB2 from one subtaks
when another one from another task is still active (in the same
connection),
which could lead to problems, IMO. When the whole process runs in batch
using interfaces for CAF or RRSAF, I believe you will run into problems,
because the DB2 batch interfaces (CAF and RRSAF) will not allow you
to build a second connection when there is already an active connection
in the same batch program.
But: the TSO interface allows it, because it is bound to the currently
running
subtask. So I think it should be possible to open DB2 connections in the
subtasks concurrently, if the batch program runs under the control of the
TSO batch (the name is something like IJKEFT01, should be omni-present
in your installation). AFAIK, the connection (for each subtask) is build
automaticcally
when issuing the first SQL statement in each subtask, using the parameters
(PLAN, SUBSYTEM) from SYSTSIN.
I'm not sure about that, because I never tried it;
but: what I did in the past: in TSO we had ISPF calls using SELECT PGM and
SELECT CMD, which establish subtasks, too, and there I realized that, using
TSO DB2 interfaces, every subtask has it's own DB2 environment. And I
believe
this should work in a pure batch program (with TSO, without ISPF), too ...
if you use the TSO DB2 interface, that is DSNELI.
Kind regards
Bernd
Am 04.07.2015 um 05:46 schrieb John P. Baker:
I am looking for any pointers to documentation describing how to structure a
multitasking assembler program where multiple subtasks are concurrently
accessing DB2.
No two (2) subtasks will be accessing the same DB2 table concurrently.
Any assistance will be most welcome.
John P. Baker