IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COBOL's awareness of system around it?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 6966
Location: porcelain throne

PostPosted: Tue Apr 17, 2012 5:48 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Apr 17, 2012 5:50 pm
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: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Apr 17, 2012 9:43 pm
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: 1353
Location: Israel

PostPosted: Wed Apr 18, 2012 2:55 am
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Apr 18, 2012 4:05 am
Reply with quote

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

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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Apr 18, 2012 6:51 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top