Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How does a called pgm know if its called from CICS or Batch
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: 8088
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 29, 2016 9:44 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1720
Location: NY,USA

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

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Nov 29, 2016 11:26 pm    Post subject: Reply to: How does a called pgm know if its called from CICS or Batch
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

Senior Member


Joined: 21 Sep 2010
Posts: 1720
Location: NY,USA

PostPosted: Tue Nov 29, 2016 11:47 pm    Post subject:
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    Post subject: Reply to: How does a called pgm know if its called from CICS or Batch
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to Clear all TSQs during CICS sta... Hooman24 CICS 4 Mon Jun 26, 2017 9:46 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts CICS Transaction Timeout Hooman24 CICS 2 Sun Apr 16, 2017 2:16 pm
No new posts HLIST Utility In Batch Virendra Shambharkar TSO/ISPF 4 Fri Apr 07, 2017 3:38 pm
No new posts Batch job tuning sgandhla Testing & Performance analysis 5 Fri Mar 24, 2017 9:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us