Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8378
Location: Dubuque, Iowa, 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: 1968
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: 7314

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: 1968
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 Send data from a CICS TS program to M... spiThingy CICS 2 Wed Aug 08, 2018 8:58 am
No new posts Error while initiation CICS program f... Ashishpanpaliya CICS 3 Mon Jul 16, 2018 5:12 pm
No new posts CICS startup problem John Poulakos CICS 3 Tue Jun 12, 2018 9:08 pm
No new posts How do you attach a DB2 plan to a CIC... John Poulakos DB2 0 Wed Apr 18, 2018 1:49 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us