0

I want to check the status of a Mainframe CICS region whether it is active or inactive by using a JCL or it is even better if one can suggest me a way to check the status of the CICS region through a shell script. This script/JCL will be used to send a mail to a group saying that the region is active/inactive at a scheduled time.

Please help me with the PROC/UTILITY to be used incase of a JCL or help me with an example of shell script to achieve it

Solution:

I executed the below command on the main screen

TSO STATUS <job-name>

and it gave me whether the job is running or not not. I have executed the same TSO command in my job and taken the output into a dataset.

ghosts
  • 177
  • 2
  • 15

3 Answers3

3

Just thinking about this briefly I see three alternatives, all involve use of SDSF (System Display and Search Facility).

Note that not all mainframe shops license SDSF, which is an IBM product. There exist ISV alternatives; I am aware of these but unfamiliar with them.

If this were being done in the shop where I work, I'd establish an SSH session with the mainframe and submit a batch job to execute the Rexx code described at the link. The batch job could check the status of the CICS region and send the email. My preference comes from having done all those things previously, I've just not put them together like this.

Your mainframe folks may have a ban on Rexx, or not allow SSH connections to their machine, or be unwilling to set up the Rexx interface to SDSF. They may feel similarly about Java.

There may be security implications, the logonID and password will be in your script, yes? What will that ID be authorized to do? How will the script be secured? Is the password for the ID required to expire periodically?

All of which is to say that you must work with (probably multiple) mainframe staff in order to make this process function correctly. None of these questions is designed to stop you from accomplishing your goal; your goal must be accomplished without compromising system security and integrity.

Some other things to think about...

Why are you checking to see if the CICS region is up? If it is because, (e.g.) you will begin a batch process to send messages to the region if it is up and notify someone if it is down, then you are best served building the error handling into your batch process instead.

Mainframe shops typically have some automation software in place to notify people when a significant event occurs - bells ring, lights flash, pagers go off, emails are sent, etc. Maybe what you're trying to do is already being handled in a different manner.

cschneid
  • 10,237
  • 1
  • 28
  • 39
  • is there a simpler way like writing a JCL to check the the status of the CICS region? – ghosts Feb 13 '13 at 10:54
  • 1
    That's what I described. Executing a program "in batch" is executing it via JCL. JCL doesn't do much of anything except execute other programs. You need a program to check to see if a CICS region is running. One of those programs is SDSF, others you could write yourself in either Rexx or Java. If I provide Rexx code to check to see if a given region is up and the JCL to run it, that won't help you execute it from your Unix shell script - for that you need authentication and authorization which is the bulk of the answer I provided and the more difficult part because it involves people. – cschneid Feb 13 '13 at 12:43
  • What is the business need for knowing if it is up? The key is who or what needs to know at that exact moment. As cschneid says, the majority of corporate mainframe installations already have such monitoring in place with a well-defined notification and response. – zarchasmpgmr Feb 14 '13 at 01:43
  • @cschneid: thanks for the explanation there may already be tools that monitor CICS regions but the information they possess will not be shared with us. So, this will help my team to know when a CICS region is down. – ghosts Feb 27 '13 at 06:59
  • You may actually want some sort of health check tx just for this purpose (from Linux/Unix/Aix). If your installation has a scheduling product a "condition" may be "posted". There may be a TCP/IP solution. In a CICSPLEX this may be time critical as regions may be phased in and out according to load, and you may want IMS or DB2 as well. I remember in one shop we would test for DB2 and then wait 20s as the status was premature in indication (lied to us). Grepping lines from the job output for the point where "control passed" may take too long end to end. A "ping like" solution seems sensible. – mckenzm Mar 29 '15 at 16:51
1

A couple of other options:

  • You can also run the Status (ST) command - just run TSO background (IKJEFT01) and issue the status command see Status command for the appropriate job names.
  • You could try running a Cics Command from a batch job see Batch Cemt New copy. If it works CICS is up, fails CICS is not up, I would suggest an inquiry rather than a New Copy though.
Community
  • 1
  • 1
Bruce Martin
  • 10,358
  • 1
  • 27
  • 38
0

One method is to add a job step to the CICS region. Define this job step to ALWAYS run, or even better define it to run ONLY if the CICS job step fails.

In this job step invoke the program that sends e-mails to everyone in the interested parties group.

This way, when the CICS region abends everyone gets a notification, but if the job is brought down cleanly as part of regular operations, no one gets an e-mail.

Alternatively, you might want to always send out an e-mail when the region comes down regardless of the reasons.

This solution avoids having to poll the region to see if it is up. For example, what happens if the region name is changed? The scripts have to be changed! Or what if a second or third production region is added? Again, all the scripts have to be changed.

Finally, you could add a step zero to the region so that everyone gets notified when the region comes UP!!

JackCColeman
  • 3,777
  • 1
  • 15
  • 21
  • Interesting angle, but unfortunately S122 and S222 would prevent the final step running. E-mails have no guaranteed delivery time, but another method could be chosen if the thing worked with S122 and S222. – Bill Woodger Sep 05 '13 at 14:34