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

Need to find the region name


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Apr 17, 2013 10:21 pm
Reply with quote

Team,

I have a program ABCP0001 , How may I get the region names (DEV,QA,PROD) where this program is executing?

Do we make any entry of the region names during the PPT/PCT entry?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 17, 2013 10:28 pm
Reply with quote

There is a CICS system programming feature that can return the job name of the CICS region:
Code:
EXEC CICS INQUIRE SYSTEM JOBNAME(<8-char variable>) END-EXEC
However, your program must be compiled with the SP option of CICS to be able to use this API call -- whether or not your site permits you to do so will depend upon the site.

Unless your site has something specifically set up to denote the region type, there is nothing else within CICS to distinguish a production from QA from test region.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Apr 17, 2013 10:31 pm
Reply with quote

see here on the ways to identify a LOCAL CICS <region>
pic.dhe.ibm.com/infocenter/cicsts/v4r1/index.jsp?topic=%2Fcom.ibm.cics.ts.intercommunication.doc%2Ftopics%2Fdfht15f.html

anyway the need for a <transaction> to determine the CICS <region> name/identifier/....
and depend on it
is by general consensus a symptom of a bad design

furthermore the CICS <region> is is a technical system installation definition detail
for example
multiple APPLICATION OWNING REGIONS are seldom implemented in testing and friends
but are commonly implemented in PRODUCTION according generally to performance reasons and concerns

and the application developers HAVE NO SAY on it
seen quite often pseudo smart developers getting burned icon_cool.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Apr 17, 2013 11:26 pm
Reply with quote

Quote:
seen quite often pseudo smart developers getting burned


icon_smile.gif icon_smile.gif


Let me be more specific, if I have 3-DEV, 3-QA, 1-PROD then how can I tell CICS to execute in the specific region in QA/DEV?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Apr 17, 2013 11:30 pm
Reply with quote

Quote:
But if I have 3-DEV, 3-QA, 1-PROD then how can I tell CICS to execute in the specific region in QA/DEV?

icon_eek.gif
reread the manuals please!
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Apr 17, 2013 11:32 pm
Reply with quote

OKay Sir...icon_smile.gif
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 17, 2013 11:55 pm
Reply with quote

The APPLID is a parameter defined to the SIT (System Initialization Table) and is normally maintained by your CICS System Programmer and/or Tech Support group and can be programmatically extracted via the EXEC CICS ASSIGN APPLID () API, an 8-Byte value.

It must also be defined as a VTAM Major Node. Otherwise, no connectivity....
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Apr 18, 2013 7:08 pm
Reply with quote

These are two different questions:
Rohit Umarjikar wrote:
How may I get the region names (DEV,QA,PROD) where this program is executing?

Rohit Umarjikar wrote:
how can I tell CICS to execute in the specific region in QA/DEV?


Question 1: collect by yourself all the SYSIDs and APPLIDs of all your CICSs. You won't get the region name but you can try to find a pattern (for example, all DEV CICS start with T, all prod start with P) to identify the use of the region.
or use the INQUIRE command as shown by Robert.
or talk to your CICS admin.

Question 2: it depends on how your system is configured (program autoinstall ?), and it depends on how the program is executed (CALLed, XCTLed or through EXCI or ...).
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Apr 18, 2013 8:32 pm
Reply with quote

Thanks everyone....

Just a bit of confusion...
Let's say we have 3 QA regions viz,
CICSQA1
CICSQA2
CICSQA3

So how would CICS decides which one to pick it up during the execution, how program vs these regions are mapped...
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Apr 18, 2013 9:32 pm
Reply with quote

I guess it is the one you log in to. For a batch job I guess it would be the dataset names etc.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Apr 18, 2013 10:08 pm
Reply with quote

Hello,

Quote:
So how would CICS decides which one to pick it up during the execution
CICS does not "pick it up". Whichever CICS is active (i.e. where the user logged on) is where the transaction will run.

Maybe i am missing something here . . .
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Apr 18, 2013 10:15 pm
Reply with quote

But from the application programming view, if I want to validate against the valid regions then

I might code like

Code:
IF CICSQA1  OR
    CICSQA2  OR
    CICSQA3 

    CONTINUE

ELSE
   ERROR AND RETURN
END-IF


Now this is a bit of hardcoding stuff, where is if tomorrow a new region comes in and they want my program to also run there then this will fail, so how generally we implement this idea...?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 18, 2013 11:03 pm
Reply with quote

Quote:
Now this is a bit of hardcoding stuff, where is if tomorrow a new region comes in and they want my program to also run there then this will fail, so how generally we implement this idea...?

YOU DO NOT... RIP

what is that Your idiot application designers
do not understand when we tell that having a dependency on the configuration names is a poor/inconsiderate/stupid/incompetent application design ???

and that any decent quality assurance will comment very unpleasantly about it ???
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Apr 18, 2013 11:12 pm
Reply with quote

Enrico,
I follow you on this when we have a new development.

But my question comes up when we talked about the old CICS programs which have been coded 12 to 15 years back...( and they might not have thought of this that time).
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 18, 2013 11:29 pm
Reply with quote

Quote:
But my question comes up when we talked about the old CICS programs which have been coded 12 to 15 years back..


then somebody will have to plan the resource availability for a logic upgrade

CICS was quite different TEN years ago,
and Your colleagues cannot pretend to put any constraint on the layout and naming conventions of the subsystems .

simple example
once upon a time You could identify the AOR <region> using PROD
one application owning region was all that was needed

now the SLA and performance considerations force to split the load across more AORs ... PROD1, PROD2, ..., PRODn

You still will have to change all the application programs to check
instead the FULL <name> a substring of it

and somebody inside Your organization will be really pissed that they cannot make the adjustement needed to satisfy the SLA ( service level agreement ) because of a dumb application design
( and the SLA means MONEY )

nuff said.

time to lock the topic
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Apr 18, 2013 11:44 pm
Reply with quote

Hello,

Quote:
Now this is a bit of hardcoding stuff, where is if tomorrow a new region comes in and they want my program to also run there then this will fail, so how generally we implement this idea...?
As has been mentioned multi[ple times, you don't.

Consider, if the code is running it is in a proper CICS. . . If the transaction/program has not been set up for some region(s), it will never run there and the need to ensure a "good" region is unnecessary . . .

Why does someone believe this is needed?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Apr 18, 2013 11:54 pm
Reply with quote

Quote:
Why does someone believe this is needed?


This is in place already in one of the existing program, and I am doing some modifications to the code...so during the testing of this program , I got into these questions....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Apr 19, 2013 1:19 am
Reply with quote

Hello,

If you are going to work on the code, maybe this can help:
Code:
EXEC CICS
         ASSIGN APPLID (COMM-HOLD-REGION-ID)
         RESP                 (WS-CICS-RESPONSE)
END-EXEC.
.
.
test WS-CICS-RESPONES code here for '00'
.
.
EVALUATE COMM-HOLD-REGION-ID
                WHEN 'TESTREG
 
                WHEN 'PRODREG'
 
                WHEN OTHER
 
END-EVALUATE.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Apr 19, 2013 1:32 am
Reply with quote

Yes dick... I did a little modifications to it

Code:
EXEC CICS ASSIGN
    SYSID(WS-SYSID)
END_EXEC


So by this I do not need to worry about any multiple CICS region's under the same SYSID.

For e.g. QA has SYSID-SYSA then this can have multiple regions (CICSQA1,CICSQA2,CICSQA3.....)

So my conditons will be,

Code:
EVALUATE WS-SYSID TRUE

WHEN 'SYSA'
   SET QA-region to true
WHEN 'SYSB'
   SET PROD-region to true
WHEN OTHER
   SET REGION-ERROR to true

END-EVALUATE


I hope this would be more generic than having specific region checks...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Apr 19, 2013 2:00 am
Reply with quote

Hello,

I suppose i'm still lost<g>.

Why does the code care which "region" is true? If it is running at all, the "region" is valid. I suspect that the WHEN OTHER would never be processed.

If the SYSID can be shown on a screen or a report, why is any "verification" needed?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Apr 19, 2013 2:32 am
Reply with quote

Quote:
Why does the code care which "region" is true? If it is running at all, the "region" is valid. I suspect that the WHEN OTHER would never be processed.


Qa has many SYSID like, DSNX(not for us at all but for the other team and they should not call this TRX),DSNA is only one where out group of people are working and all of out apps are installed. so OTHER condition still holds true if it is not DSNA(QA)/DSNP(PROD).

Hope I am explaing the reasons in the right way..
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Sun Apr 21, 2013 5:51 pm
Reply with quote

Sometimes, some programs need to know where they are running.
Here is something I proposed to my boss:
  1. Use a INITPARM. For example:
    in all CICS test regions: INITPARM=(GETRGNTP='TEST')
    in all CICS prod regions: INITPARM=(GETRGNTP='PROD')

  2. Write a small routine that reads the INITPARM and returns the value.
    (see INITPARM and INITPARMLEN options in the ASSIGN command)
    in this case, the routine name is GETRGNTP and, when called, will return TEST, PROD or whatever value.
My proposition was refused and now, instead of that, these programs have to do an ASSIGN APPLID and check for patterns.
I still think my idea was better...
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Mon Apr 22, 2013 9:53 am
Reply with quote

Yeah...I do like your idea.. but admin people do not like to play around the region parameters...so better get it done in the application programming ( thats is what we hear from them)...icon_smile.gif
Back to top
View user's profile Send private message
Bala_real

New User


Joined: 08 Jun 2013
Posts: 1
Location: india

PostPosted: Thu Jun 13, 2013 2:35 pm
Reply with quote

As you aware that the program you mentioned will be invoked via some transaction.

you can go and check the transaction in which region it is defined.

if transaction in 1st region then cics will execute program defined in CICSQA1.
if transaction in 2nd region then cics will execute program defined in CICSQA2.
same as for others.

if your transaction is defined in 1st region only
then CICSQA2 and CICSQA3 programs will not get execute unless these two entries remotely defined to 1st region. vice versa for others.

i hope it is clear.
icon_smile.gif
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Open VSAM File in IMS DC Region - DFS... IMS DB/DC 0
No new posts CICS region is terminated abnormally ... CICS 2
Search our Forums:

Back to Top