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

How to have a exclusive control for online file


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

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Fri Jul 25, 2008 1:06 pm
Reply with quote

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

Senior Member


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

PostPosted: Fri Jul 25, 2008 3:42 pm
Reply with quote

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

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Fri Jul 25, 2008 5:28 pm
Reply with quote

try these links;

cicswiki.org/cicswiki1/index.php?title=How_do_I_close/open_files_for_Batch_Jobs%3F

cicswiki.org/cicswiki1/index.php?title=CICS_24x7_Processing

cicswiki.org/cicswiki1/index.php?title=BatchCICS-Connect_-_24x7_Integration
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Fri Jul 25, 2008 7:11 pm
Reply with quote

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

Senior Member


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

PostPosted: Fri Jul 25, 2008 7:47 pm
Reply with quote

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

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Fri Jul 25, 2008 10:03 pm
Reply with quote

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

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Mon Jul 28, 2008 2:18 pm
Reply with quote

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

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Mon Jul 28, 2008 2:20 pm
Reply with quote

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

New User


Joined: 09 Mar 2006
Posts: 2
Location: Peoria, IL

PostPosted: Fri Aug 01, 2008 8:46 pm
Reply with quote

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
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top