Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
CICS Transaction and Batch job Contention
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
Author Message
feellikeneo

Active User


Joined: 19 Mar 2007
Posts: 79
Location: Chennai

PostPosted: Fri Aug 08, 2008 4:35 pm    Post subject: CICS Transaction and Batch job Contention
Reply with quote

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

Senior Member


Joined: 20 Oct 2006
Posts: 1618
Location: germany

PostPosted: Fri Aug 08, 2008 4:46 pm    Post subject:
Reply with quote

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

Active User


Joined: 19 Mar 2007
Posts: 79
Location: Chennai

PostPosted: Fri Aug 08, 2008 5:06 pm    Post subject:
Reply with quote

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

Active User


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

PostPosted: Fri Aug 08, 2008 5:21 pm    Post subject:
Reply with quote

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

Active User


Joined: 19 Mar 2007
Posts: 79
Location: Chennai

PostPosted: Fri Aug 08, 2008 5:31 pm    Post subject:
Reply with quote

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

Senior Member


Joined: 20 Oct 2006
Posts: 1618
Location: germany

PostPosted: Fri Aug 08, 2008 5:32 pm    Post subject:
Reply with quote

are we talking about 2 records in a vsam file

or

two rows on a db2 table?
Back to top
View user's profile Send private message
feellikeneo

Active User


Joined: 19 Mar 2007
Posts: 79
Location: Chennai

PostPosted: Fri Aug 08, 2008 5:37 pm    Post subject:
Reply with quote

Dick,

I am concerned about two rows on a DB2 table.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Fri Aug 08, 2008 5:48 pm    Post subject:
Reply with quote

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

Active User


Joined: 19 Mar 2007
Posts: 79
Location: Chennai

PostPosted: Fri Aug 08, 2008 6:01 pm    Post subject:
Reply with quote

Craq,

Exactly said.. (you should have sneaked into my application icon_wink.gif )

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

Senior Member


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

PostPosted: Fri Aug 08, 2008 6:07 pm    Post subject:
Reply with quote

Add a sequence and change the table index to use timestamp & sequence.
Back to top
View user's profile Send private message
feellikeneo

Active User


Joined: 19 Mar 2007
Posts: 79
Location: Chennai

PostPosted: Fri Aug 08, 2008 6:32 pm    Post subject:
Reply with quote

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 icon_sad.gif

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 icon_sad.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1618
Location: germany

PostPosted: Fri Aug 08, 2008 6:49 pm    Post subject:
Reply with quote

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

Active User


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

PostPosted: Fri Aug 08, 2008 7:07 pm    Post subject:
Reply with quote

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

Active User


Joined: 25 Jul 2006
Posts: 208

PostPosted: Fri Aug 08, 2008 7:09 pm    Post subject:
Reply with quote

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

Active User


Joined: 19 Mar 2007
Posts: 79
Location: Chennai

PostPosted: Mon Aug 11, 2008 3:34 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 HoursGoto page 1, 2  Next
Page 1 of 2