Re: Single Source CICS/Batch



William M. Klein<wmklein@xxxxxxxxxxxxxxxxx> 10/30/06 4:53 PM >>>
I thought that there was documentation on how to create a "separately
compiled"
program to be called (usually dynamically) by both a CICS and non-CICS main

program, but so far I can't find it. Therefore, the following is MOSTLY
from
memory (possibly erroneous). You probably should start by reading the
information at:


http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3pg31/3.1.1.2


1) Make certain the subprogram has
DFHEIBLK and DFHCOMMAREA
as the first two parameters in Linkage Section (even though you will NOT
use
them in the batch version). (If you don't translate the subprogram source
code,
this MAY not be required.)

I'd like to make, not a correction exactly, but an observation or two:

1) As you say, if you do not translate the subprogram then you definitely
don't need (or want) to include DFHEIBLK and DFHCOMMAREA as the first two
parameters.

2) Even if you do translate it there's what I consider to be a better
option. Use the NOLINKAGE translate option "PROCESS XOPTS(CICS,NOLINKAGE)".
In order to make this work you have to do a few additional things:
- define DFHEIBLK yourself by putting "COPY DFHEIBLK" (or "COPY DFHEIBLC")
in the LINKAGE SECTION.
- explicitly establish linkage to both the EIB and the commarea:
EXEC CICS ADDRESS
EIB (ADDRESS OF EIBLK)
COMMAREA (ADDRESS OF COMMAREA)
END-EXEC

By doing all of the above you can call the routine under CICS as you would
under batch, ie.
CALL PROGRAM-NAME USING PARM1, PARM2

Of course you'll only want to do that if you know you are executing under
CICS.

Again, none of the above is necessary if the COBOL subroutine does not need
to execute any CICS statements.

By the by, I have a COBOL program that works under CICS TS for VSE that will
tell you if you are running under CICS or not. Not sure if it would work
with MVS, but I can post it if someone wants it.

Frank



---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
.



Relevant Pages

  • Re: Wait under CICS
    ... EIB (ADDRESS OF DFHEIBLK) ... The DFHEIBLK copybook is in the CICS SDFHCOB source library, so you need to make sure that is in your SYSLIB concatenation for the compile. ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: STICKY LINKAGE
    ... in CICS is after EXEC CICS LINK/XCTL and not after a COBOL CALL ... simple reason that LINKAGE SECTION items can be, in the compilers I know of, ... 01 MY-DYNAMIC-AREA PIC XBASED. ...
    (comp.lang.cobol)