View previous topic :: View next topic
|
Author |
Message |
dragonb
New User
Joined: 08 Nov 2010 Posts: 8 Location: Chennai
|
|
|
|
Is there a possible way to know whether a particular Transaction is running or not in CICS region through a cobol program or JCL? If so how?
Thnx,
Dragonb |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Transaction-time is usually sub-second or on rare occasions, 1 or 2 seconds.
Using an EXCI interface from Batch to a user-written program may work, with the likelihood that you may find the transaction executing within the same split-second the user-written program is executing, is a roll of the dice.
If you assign a unique/well known RESOURCE-ID to the target transaction (program defined to PCT entry) and your user-written program attempts to ENQ on this RESOURCE-ID resulting in an "ENQBUSY" condition, then this may be a method to determine whether the transaction is executing. Then the user-written program can return information back to Batch in the EXCI commarea, to indicate the transaction is running ("ENQBUSY") or not.
But, consider that you've reduced the throughput of the entire region.
ENQ/DEQ API's should be used sparingly and justification must be proven.
Bill |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
whether a particular Transaction is running or not in CICS region |
The question is, what do you mean by this? Typically CICS transactions run for hundredths of a second, display a map on the user terminal, and return to CICS to await the user response. While waiting for the user, the transaction is (usually) ready to start at the terminal again, but there actually is no transaction running the whole time the user is on the map. As Bill said, it is really unlikely that you'll find an actual transaction running when you try the interface -- unless there are hundreds of users using the same transaction (and in that case, why would you want to find out about the transaction?). |
|
Back to top |
|
|
dragonb
New User
Joined: 08 Nov 2010 Posts: 8 Location: Chennai
|
|
|
|
Thanks for the reply.
My transaction in CICS will run 24x7. I want to check whether that transaction is up/down from a batch job. Based on that, if my trasaction is down, I need to submit a batch job, which will bring up the transaction again.
So based on my requirement I am not allowed to introduce a new map in the region. Could you please help me with that?
Thanks,
Dragonb |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
You are needlessly complicating things by involving batch. If your transaction updates a VSAM file with the current time at regular intervals, you can write a second transaction that runs interval-controlled and checks that the time on the VSAM record is within some period of time. If not, the second transaction can start the first one again. No batch is required.
If you want to really bullet-proof the process, the second transaction can update a current time field in the VSAM record, and the first transaction can verify that the last time is within some period of time and if not, restart the second transaction.
Have both programs started from the PLT and they can run as long as the CICS region is up. |
|
Back to top |
|
|
dragonb
New User
Joined: 08 Nov 2010 Posts: 8 Location: Chennai
|
|
|
|
Hi,
The scenario why I introduce a batch job is, this job will be scheduled in a scheduler. So when processing is switching from batch mode to online mode , I need to make a check whether transactions are up. And if this transaction is down, I need to bring it up before the online window starts. |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
Your installation must surely have operation automation software to start CICS transaction on certain events, so there should be no need to develop batch application programming for this.
Ask your operations support personnel. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
In other words, you have decided what your solution is -- so why did you bother to post anything here in the first place? Go ahead and implement whatever you've decided you need to do.
You have not said why you need a batch job scheduled, nor have you said why a transaction supposedly running 24/7 would ever NOT be running. CICS transactions do not generally run 24/7 since this causes resource issues within CICS; most transactions that are running all day are interval controlled and start up only every now and then. If this is your case, you cannot tell if the transaction is scheduled to run as that is controlled by CICS. |
|
Back to top |
|
|
dragonb
New User
Joined: 08 Nov 2010 Posts: 8 Location: Chennai
|
|
|
|
Hi,
This is not the solution. I am planning to do it this way. The transaction which is supposed to be running 24/7 is Queue triggered transaction. Once the transaction is up, it goes down only when the Queue is full or a interrupt is set to bring it down(since this is a banking application transaction). Under such scenario, I need to make a check whether the transaction is up. Apart from bringing up the transaction, I have some internal process to do and this is the reason why introduce a batch job. |
|
Back to top |
|
|
Nimesh.Srivastava
New User
Joined: 30 Nov 2006 Posts: 78 Location: SINGAPORE
|
|
|
|
dragonb,
you may utilize the CICS API INQUIRE TASK LIST to achieve the same.
Note, that this would return all running tasks in the CICS region at that moment of execution and your task may be one of it.
We had a similar requirement [but not for queue initiated transaction] in our shop and the way we achieved it
1/ a new CICS transaction, utilizing INQUIRE TASK LIST and thereafter parse the transaction identifier list for the transaction running or not at that moment of time.
2/ trigger this new CICS transaction via a batch JCL using INTRDR - you may ask your infra for a similar job utilized in your shop
3/ if found, update a entry in the VSAM against that transaction indicating its RUNNING / DISPATCHABLE / SUSPENDED
4/ a new batch job scheduled after the batch trigger of this CICS transaction; which would check this VSAM entry and depending on requirement would return <> 0 for scheduler to perform needed action based on RC.
5/ this batch job may then reset the entry or status field in the VSAM for next processing
btw, for queue initiated transactions why is your task always running in CICS, shouldn't it exit upon queue empty condition.
Nimesh |
|
Back to top |
|
|
|