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: 7913
Location: Bellevue, IA

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: 1610
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: 7234

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: 1610
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
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 CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
This topic is locked: you cannot edit posts or make replies. MIPS reduction for Batch job Virendra Shambharkar All Other Mainframe Topics 8 Mon Nov 07, 2016 4:02 pm
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am


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