View previous topic :: View next topic
|
Author |
Message |
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi All,
Could you please suggest,how to have exclusive control for an online file.This online file is used by two jobs one is batch job and the other Job is invoked by the transaction.
I tried using Disp=Old for the batch job but wasnt successfull as the file is used by the other job at the same time and CICS hold this online file.
Cannot use the delay.
One batch job updates the file and the other job read the file.
Kindly suggest!!
TIA
Regards
Himanshu Sharma |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
If CICS is using the file and you can't close it while you need exclusive control, you can't get exclusive control of the file in batch.
If a batch job updates the file you cannot have it online in CICS during the updates - a CICS update could overwrite or be overwritten by a batch update. You must close the file in CICS while batch update runs.
Garry. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi,
let me try to be specific.I have two jobs which uses online file one job is the batch and runs once a day at specific time,the other job is invoked by the online pgm and it could be anytime in a day.
These both jobs uses same online file the batch job uses this file to update and the online job uses to read.
There are situations when both the jobs has run at the same time.As the disp=shr gave contention for the file and abended.
The batch job is closing and opening the file while updation.
So i thought of changing the disp=shr to old for the batchjob but when CICS was up it took the control of the file and and didnot pass this file to batch job for an half an hour so i forcefully cancelled the batch job.
Below mentioned is the contention.
" CONTENTION WITH CIPA7398(CICS REGION) OWNS SHR ON MII12
NEEDS EXCL SYSDSN COS.ONLINE.DV.GTIN.PRD300A
WAITING FOR RESOURCES FOR 27.1 MINUTES"
Could anybody tell me why CICS took the control of the file as i didnot use old for the online job,it was mentioned for the batch job.
I cannot use the delay also in the pgm.
Is there anyother option i can use please suggest!!!
Regards
Himanshu |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
How exactly are you closing the file in CICS? Do you CLOSE,DISABLE? Are you doing this in a step in the job or manually before running Batch?
If you run the batch program before CICS has completed the CLOSE, the batch job will find the file still OPEN - you need some delay/wait while CICS completes the CLOSE.
If you don't DISABLE, then a CICS task can automatically re-OPEN the file before the batch program issues the OPEN and/or the file is still seen as ALLOCATED to CICS. DISP=OLD will wait until nothing else has the file allocated.
Regards,
Garry. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
IF cics file is defined as OPEN on first reference, then an online
transaction could trigger the open after you have manually closed.
file must be closed and disabled for batch usage.
Many shops have vendor software to perform this function from
batch. Check with your CICS Systems programmer.
If you don't have this type of software, then I recommend
you consider a product like Use [URL] BBCode for External Links
or review this for list of others;
www.cicsworld.com/tools/Batch |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi All,
Thanks for your reply.
However the batch job has the first step to close the file but the first step itself didnot run.As it was waiting for the resource from the CICS region.Attaching the spool for the batch job for your reference. |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi All,
When ever the batch job runs it first closes the file,however the step didnot run.The same job is running fine when it has the disp=Shr but as i have changed the Disp=Old,The batch job was waiting for the resource from the CICS region.
Regards
Himanshu |
|
Back to top |
|
|
kick_support
New User
Joined: 09 Mar 2006 Posts: 2 Location: Peoria, IL
|
|
|
|
Create a dummy file and add this file in both of the batch jobs with disp=old. Disp=old on the dummy file will of single-thread the batch jobs but allow you to close the "real" file to CICS. |
|
Back to top |
|
|
|