View previous topic :: View next topic
|
Author |
Message |
Graeme Westerman
New User
Joined: 29 Nov 2016 Posts: 1 Location: UK
|
|
|
|
Hi, we have a Cobol developer who is trying to call a subroutine from both CICS and Batch. The subroutine obviously has to pass back data to the calling program. How does the called program know that the calling program is batch or CICS?
Thanks
Graeme |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
How does the called program know that the calling program is batch or CICS? |
Why does it care? As long as the COBOL program isn't doing anything prohibited under CICS (such as reading a file) and has the DFHEIBLK and DFHCOMMAREA defined in the calling sequence, the same subprogram should run under CICS and batch without knowing -- or caring -- where it is running. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Rohit,
Other than the other Bill's Assembler, what is there that is of use relating to the question? It is also eight years old.
Graeme Westerman,
As Robert asked, why does the program need to know? There are some very direct ways, but if the program doesn't need to know, why even bother with those? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
The routine must check the received DFHEIBLK to detect if it is running under CICS or in Batch
Shouldn't this help? |
|
Back to top |
|
|
Ricardo Guerra
New User
Joined: 08 May 2015 Posts: 4 Location: Argentina
|
|
|
|
I work on that and the solution we use is to pass a parameter in the input data when you call the routine to distinguish from where is called.
Is a very simple solution and works. |
|
Back to top |
|
|
|