IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How does a called pgm know if its called from CICS or Batch


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Graeme Westerman

New User


Joined: 29 Nov 2016
Posts: 1
Location: UK

PostPosted: Tue Nov 29, 2016 9:25 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Nov 29, 2016 9:44 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Nov 29, 2016 9:47 pm
Reply with quote

Welcome!!
Couple of replies from bottom should help you knowing that.
ibmmainframes.com/about27389.html
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Nov 29, 2016 11:26 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Nov 29, 2016 11:47 pm
Reply with quote

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
View user's profile Send private message
Ricardo Guerra

New User


Joined: 08 May 2015
Posts: 4
Location: Argentina

PostPosted: Thu Apr 06, 2017 12:56 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
Search our Forums:

Back to Top