Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Status of CICS transaction from Batch COBOL program/JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Status of CICS transaction from Batch COBOL program/JCL
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Jan 21, 2011 4:37 pm    Post subject: Reply to: Status of CICS transaction from Batch COBOL progra
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: 7904
Location: Bellevue, IA

PostPosted: Fri Jan 21, 2011 6:59 pm    Post subject:
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    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Sat Jan 22, 2011 8:41 pm    Post subject:
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    Post subject:
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    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Mon Jan 24, 2011 6:14 am    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
This topic is locked: you cannot edit posts or make replies. MIPS reduction for Batch job Virendra Shambharkar All Other Mainframe Topics 8 Mon Nov 07, 2016 4:02 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us