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
 

 

COBOL's awareness of system around it?

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

New User


Joined: 10 Dec 2010
Posts: 10
Location: Chicago

PostPosted: Tue Apr 17, 2012 5:06 pm    Post subject: COBOL's awareness of system around it?
Reply with quote

Hello,

I poked around a bit on here and google but I coudln't find quite what I was looking for, maybe someone can point me the right way.

I have several cobol programs that create reports and all of them check PCB parameters for their enviornment data (is it running from test or production?).

My problem is that I have one program that uses no PCBs, no ims calls. I'm trying to find a possible enviornment variables that I could use to findout where my program is running. I wasn't sure if COBOL is as self aware as IMS is.

Unfortunately modifying the JCL or adding a dummy PCB are not going to work. If it can't be done in cobol I'm going to have to live without it.

Thanks for any help you can provide.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Tue Apr 17, 2012 5:48 pm    Post subject:
Reply with quote

your understanding of the systems (based on your comments)
is the reason (cause of your inability) you can't figure out how to do this.

all of us, at our sites, know the names 'tokens' used by the ops-system and
the sub-systems (db2, ims, MQSerious)
to determine what,where you are.

to say that ims is aware, is a silly statement.
the only reason that you know if you are in prod, test, qa, etc...
is due to the token used.
and each of these subsystems (ims, db2, etc...) has an API to return the token to the user.
Thus the user could know where he is based on the token.

The only thing that comes to mind,
and is not dependent on a sub-system defintion
is LPAR

i would suggest thinking on the lpar level, those are all different,
and they are retrievable via COBOL, one example is here, at the bottom of the page
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Apr 17, 2012 5:50 pm    Post subject: Reply to: COBOL's awareness of system around it?
Reply with quote

Do you have any "symbols" in JCL which indicate test/production (like elements of any dataset names). These you could look at passing to the Cobol program as a PARM,
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2433
Location: Netherlands, Amstelveen

PostPosted: Tue Apr 17, 2012 9:43 pm    Post subject:
Reply with quote

This is again a load of crap. Does the TS know what it is talking about?
No PCB? Once in a while a PCB? Half a PCB?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Wed Apr 18, 2012 2:55 am    Post subject:
Reply with quote

Follow the links in this thread: Capturing the JOBNAME in COBOL program.
Once you have the job name or other job info, you can recognize where you are.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Wed Apr 18, 2012 4:05 am    Post subject: Reply to: COBOL's awareness of system around it?
Reply with quote

Programmatically detect the run environment; CICS or Batch, using CICS Macro DFHAFCD -

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

One minor change to the above sub-program; Replace R12 with R3 as the Base-Register.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Wed Apr 18, 2012 6:51 am    Post subject: Reply to: COBOL's awareness of system around it?
Reply with quote

If Assembler gives management the hives, review LE Callable Service routine CEE3INF, which was introduced with z/OS 1.9 -

CEE3INF Link

In fact, CEE3INF returns much more information and could be used programmatically to provide much more than just the run-environment.

Please review the above link....
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. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


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