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
 
Know from which environment the subroutine is called

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
srinut123

New User


Joined: 11 Oct 2005
Posts: 62
Location: India

PostPosted: Fri Aug 27, 2010 9:31 am    Post subject: Know from which environment the subroutine is called
Reply with quote

Hi
We are using a subroutine in written in COBOL in both Batch and Online (CICS) programs. Is there any way to know from which environment the subroutine is called? Any COBOL LE functions?

Thanks
Sri
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Fri Aug 27, 2010 11:52 am    Post subject: Reply to: Know from which environment the subroutine is call
Reply with quote

In Language Environment 1.8, review Callable Service routine CEE3INF.

Or, you can use the sub-program posted in the following -

http://www.ibmmainframes.com/viewtopic.php?p=116520&highlight=#116520

However, there is one change I'd recommend in the above RUNENV sub-program.

Use R3 instead of R12 as the base-register.

Otherwise, source-code comments and comments in the post itself should suffice.

You can call RUNENV Statically or Dynamically.

The entire load-module length is under 80-bytes.... icon_eek.gif

Bill
Back to top
View user's profile Send private message
srinut123

New User


Joined: 11 Oct 2005
Posts: 62
Location: India

PostPosted: Mon Aug 30, 2010 10:24 am    Post subject:
Reply with quote

Thanks Bill
I'll give a try with the Assembler routine..

Thanks
Sri
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Aug 30, 2010 10:28 am    Post subject:
Reply with quote

Hello,

Just curious, but why would the code act differently depending how it was called?

If this is a common subroutine, does it not behave the same either way?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Mon Aug 30, 2010 3:26 pm    Post subject: Reply to: Know from which environment the subroutine is call
Reply with quote

Dick,

I didn't think I indicated that there would be different behavior, depending on how the sub-program had been accessed.

Just gave him the option of either Static or Dynamic.

If there's only a couple of Caller's involved, then I'd go with Static. Plus, if the given "common" Caller was executing in CICS, a PPT entry is not needed for a Static call.

Bill
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Aug 30, 2010 7:36 pm    Post subject:
Reply with quote

Hi Bill,

No, you didn't icon_smile.gif

I was just wondering why it matters how/where it was invoked if the code is supposed to do the same thing in both environments. . .
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Wed Sep 01, 2010 4:33 am    Post subject:
Reply with quote

I recall that it can be an issue to document exceptions or abends on either the CICS log or in SYSOUT DD dependent on if a module has been called from CICS or from batch.
Back to top
View user's profile Send private message
srinut123

New User


Joined: 11 Oct 2005
Posts: 62
Location: India

PostPosted: Tue Sep 07, 2010 10:59 am    Post subject:
Reply with quote

My subprogram takes the data from Caller and will push the data to MQ. We have different MQ wrapper programs for Online and Batch. I can't use Batch routines in Online environment and vice versa. That is the reason I wanted to know if there is any way to know the environment and can call the wrapper MQ programs accordingly.

Thanks
Sri
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Wed Sep 08, 2010 2:41 am    Post subject:
Reply with quote

If the assembler routine mentioned above is giving you trouble, would it an option to actually include a parameter in the input parameters of your module to be filled with a value to govern which MQ environment interface to use?
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
This topic is locked: you cannot edit posts or make replies. DB2 for Z/OS(set up environment) Pavan kumar chauhan DB2 1 Tue Dec 05, 2017 8:03 pm
No new posts LIBDEF not working in called proc packerm CLIST & REXX 0 Fri Sep 15, 2017 7:22 pm
No new posts Could we identify the called modules ... elixir1986 COBOL Programming 5 Fri Jul 14, 2017 1:53 am
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 5 Tue Nov 29, 2016 9:25 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
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us