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

Status of CICS transaction from Batch COBOL program/JCL


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

New User


Joined: 08 Nov 2010
Posts: 8
Location: Chennai

PostPosted: Fri Jan 21, 2011 9:55 am
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Jan 21, 2011 4:37 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Jan 21, 2011 6:59 pm
Reply with quote

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
View user's profile Send private message
dragonb

New User


Joined: 08 Nov 2010
Posts: 8
Location: Chennai

PostPosted: Sat Jan 22, 2011 7:50 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Sat Jan 22, 2011 8:41 pm
Reply with quote

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
View user's profile Send private message
dragonb

New User


Joined: 08 Nov 2010
Posts: 8
Location: Chennai

PostPosted: Sat Jan 22, 2011 9:29 pm
Reply with quote

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
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Mon Jan 24, 2011 5:35 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon Jan 24, 2011 6:14 am
Reply with quote

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
View user's profile Send private message
dragonb

New User


Joined: 08 Nov 2010
Posts: 8
Location: Chennai

PostPosted: Mon Jan 24, 2011 9:10 am
Reply with quote

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
View user's profile Send private message
Nimesh.Srivastava

New User


Joined: 30 Nov 2006
Posts: 78
Location: SINGAPORE

PostPosted: Tue Jan 25, 2011 11:31 am
Reply with quote

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
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
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 Job completes in JES, but the status ... IBM Tools 1
Search our Forums:

Back to Top