IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

CICS Transaction and Batch job Contention

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC
Goto page 1, 2  Next
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> CICS
View previous topic :: View next topic  
Author Message
feellikeneo



Joined: 19 Mar 2007
Posts: 79
Location: Chennai

Posted: Fri Aug 08, 2008 4:35 pm    Post subject: CICS Transaction and Batch job Contention  

Friends,

I am facing a strange issue related to a Online transaction and Batch job.

I have one CICS online transaction XXXX which process a set of message received from other system. When this transaction runs I write all the messages into a table by splitting up the message into two halves.

When this CICS transaction is running, some batch job kicks off and writes into the same table.

My problem lies with that online transaction. Since I split that record into half and write into table, and when the batch job comes in, my records from XXXX does not go consecutively into that table and I am facing problem.

I thought of having some control table to be common between these two. Batch jobs update this control value to 'NO' during start and 'YES' at the end. And check that value in XXXX for 'YES' at starting to continue processing. If its 'NO' delay this XXXX for some 30 seconds.

But the difficulty here is when XXXX is running and batch jobs come at middle though the control table will be updated, XXXX will continue to run until that unit of work is completed. So this may again disrupt my records into the table.

Any suggestion to overcome this and interlock the Batch job and CICS transaction.

Hope I am clear with my requirement. I would be pleased to provide more info if needed.
Back to top  
dbzTHEdinosauer



Joined: 20 Oct 2006
Posts: 1639
Location: germany

Posted: Fri Aug 08, 2008 4:46 pm    Post subject:  

Is this your problem:

Quote:
my records from XXXX does not go consecutively into that table


or

Is it the 'scheduling/triggering' of the batch job, the problem?

what triggers the batch job?
Back to top  
feellikeneo



Joined: 19 Mar 2007
Posts: 79
Location: Chennai

Posted: Fri Aug 08, 2008 5:06 pm    Post subject:  

Dick,

My problem is with records not going to table consecutively. (i.e two halves should come as consecutive records)

The batch jobs is triggered by some other system, and hence I cannot have any control over the scheduling of that job.
Back to top  
Garry Carroll



Joined: 08 May 2006
Posts: 171
Location: Dublin, Ireland

Posted: Fri Aug 08, 2008 5:21 pm    Post subject:  

The problem is most likely the sharing of the file by both CICS and batch simultaneously. Usually batch applications have the file closed to CICS access CICS?

Garry.
Back to top  
feellikeneo



Joined: 19 Mar 2007
Posts: 79
Location: Chennai

Posted: Fri Aug 08, 2008 5:31 pm    Post subject:  

Garry,

I am NOT trying to share a file. The problem is since both CICS & BATCH tries to write into the same table, I am having problem.

Btw, table level/ROW level lock is also ruled out since, the batch job may abend due to contention.
Back to top  
dbzTHEdinosauer



Joined: 20 Oct 2006
Posts: 1639
Location: germany

Posted: Fri Aug 08, 2008 5:32 pm    Post subject:  

are we talking about 2 records in a vsam file

or

two rows on a db2 table?
Back to top  
feellikeneo



Joined: 19 Mar 2007
Posts: 79
Location: Chennai

Posted: Fri Aug 08, 2008 5:37 pm    Post subject:  

Dick,

I am concerned about two rows on a DB2 table.
Back to top  
Craq Giegerich



Joined: 19 May 2007
Posts: 1001
Location: Virginia, USA

Posted: Fri Aug 08, 2008 5:48 pm    Post subject:  

There is no such thing as consecutive records in a DB2 table. Add a timestamp to the records then get the current timestamp when you insert a row use the that timestamp, when you insert 2 rows use the same timestamp for both rows.
Back to top  
feellikeneo



Joined: 19 Mar 2007
Posts: 79
Location: Chennai

Posted: Fri Aug 08, 2008 6:01 pm    Post subject:  

Craq,

Exactly said.. (you should have sneaked into my application :wink: )

I am using a timestamp row and I insert the current system time along with the message. I referred this consecutive rows. Apologize for this confusion.

My table index does not allow me to use same timestamp for two rows.

I am looking for some kind of CICS/BATCH application control. Some kind of technique/tool to make both of these run without any issues.
Back to top  
Craq Giegerich



Joined: 19 May 2007
Posts: 1001
Location: Virginia, USA

Posted: Fri Aug 08, 2008 6:07 pm    Post subject:  

Add a sequence and change the table index to use timestamp & sequence.
Back to top  
feellikeneo



Joined: 19 Mar 2007
Posts: 79
Location: Chennai

Posted: Fri Aug 08, 2008 6:32 pm    Post subject:  

The CICS transaction XXXX is some kind of receiver program (just receives the message and store in some table)

If I am going to add a sequence number column, I may need to change the processor program and also adding a new column requires complex procedures in my system. My boss won't allow me that :(

I would prefer to make any changes via COBOL code without affecting the existing table/index setup. Sounds crazy, but it happens to be like this for me :(
Back to top  
dbzTHEdinosauer



Joined: 20 Oct 2006
Posts: 1639
Location: germany

Posted: Fri Aug 08, 2008 6:49 pm    Post subject:  

how often can transaction XXXX be fired off for two seeminly simulataneous tasks?

before you insert, set a host variable to current_timestamp.
set the milliseconds to zero,
INSERT first half using the host variable as source for your TS column,
add 1 millisecond to host_TS,
INSERT second.

If you ever have to go to a third row, no problem.
Back to top  
Garry Carroll



Joined: 08 May 2006
Posts: 171
Location: Dublin, Ireland

Posted: Fri Aug 08, 2008 7:07 pm    Post subject:  

If transaction XXXX is receiving "messages" can the batch program apply its messages via the same route - and thus let CICS be the sole point of contact with the DB2 table? This way, CICS would split and apply your messages before seeing a next message from anywhere.

Just a thought....

Garry.
Back to top  
Earl Haigh



Joined: 25 Jul 2006
Posts: 219

Posted: Fri Aug 08, 2008 7:09 pm    Post subject:  

suggest you review vendor software that will allow your batch cobol
program to logically control communications with CICS region.

in other words , send you batch update requests into CICS
and let a new or existing CICS application perform the updates.

look at www.batchcics.connect
Back to top  
feellikeneo



Joined: 19 Mar 2007
Posts: 79
Location: Chennai

Posted: Mon Aug 11, 2008 3:34 pm    Post subject:  

Dick,

My Transaction runs almost runs for every 10 seconds each time. XXXX will keep running but not continuously in one stretch. It will run in separate unit of work.

Adding 1 microsecond delay seems to be good idea.. We already thought on this solution. But then we do not want to manipulate the timestamp which is against coding standard in my system.. Let me consult with my colleagues to see if I can get any exception..

Thanks a lot..

Garry,

Your solution may need a code change on sender side also. I mean the sending system (triggering job) has to make change to send messages via MQ and not via batch. This may not be advisable from sender perspective. But worth a thought. Let me keep it as last option.

Earl,

Let me escalate this.

Thank you all for your great thoughts.
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> CICS Goto page 1, 2  Next
Page 1 of 2
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM