Does CICS takes care of open/close of files?

Customer Information Control System. Middleware and MQ Series.
Post Reply
RaOne
Registered Member
Posts: 27
Joined: Fri Aug 16, 2013 11:46 pm

Does CICS takes care of open/close of files?

Post by RaOne »

Hi,

While testing a CICS program I seem to make a conclusion and seek help to see if it's correct.If a file has been defined in file control table of CICS then, it looks like, it does not need to be opened explicity. Is this assupmtion correct?  Actually, I have noticed that the CICS program does not open the file explicitly if the file has a FCT entry.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1878
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Does CICS takes care of open/close of files?

Post by Robert Sample »

CICS handles all file opens and closes.  So your CICS COBOL program, for example, will not have a SELECT nor an FD nor OPEN or CLOSE verbs for any files.
RaOne
Registered Member
Posts: 27
Joined: Fri Aug 16, 2013 11:46 pm

Re: Does CICS takes care of open/close of files?

Post by RaOne »

Robert Sample wrote:CICS handles all file opens and closes.  So your CICS COBOL program, for example, will not have a SELECT nor an FD nor OPEN or CLOSE verbs for any files.
That I understand that CICS program will not have SELECT, FD, OPEN and CLOSE. What I was asking is when I was debugging there will be CALL to open a file in multiple executions. But it looks like that CCIS check if the file was open nad stil available before issuing the OPEN and does not make an OPEN request explictly.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1878
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Does CICS takes care of open/close of files?

Post by Robert Sample »

CICS has two options for file open -- at CICS start up or at first reference.  Once opened, the file will remain open until CICS shuts down, or the file is explicitly closed by a program, or a user closes it via the CEMT command.  You will not see any file opens or closes while debugging.
RaOne
Registered Member
Posts: 27
Joined: Fri Aug 16, 2013 11:46 pm

Re: Does CICS takes care of open/close of files?

Post by RaOne »

Robert Sample wrote:CICS has two options for file open -- at CICS start up or at first reference.  Once opened, the file will remain open until CICS shuts down, or the file is explicitly closed by a program, or a user closes it via the CEMT command.  You will not see any file opens or closes while debugging.
Thanks for the confirmation. That's what I have observed but was not able to prove it with some reference document...
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1878
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Does CICS takes care of open/close of files?

Post by Robert Sample »

The manual is CICS Configuring
and the wording is
CICS allows or denies access to data in a file, depending on whether the state of the file is ENABLED. An enabled file that is closed is opened by CICS automatically when the first access request is made. The file remains open until an explicit CLOSE request or until the end of the CICS job.

You can also open a file explicitly by using either of the commands

Code: Select all

CEMT SET FILE(filename) OPEN
EXEC CICS SET FILE(filename) OPEN
When you use one of these commands, the file is opened irrespective of whether its state is enabled or disabled. You may choose this method to avoid the overhead associated with opening the file being borne by the first transaction to access the file.
You can also specify that you want CICS to open a file immediately after initialization by specifying the RDO OPENTIME(STARTUP) attribute (or the FILSTAT=OPENED parameter in the DFHFCT macro). If you specify that you want CICS to open the file after startup, and if the file status is ENABLED or DISABLED, the CICS file utility transaction CSFU opens the file. (CSFU does not open files that are: defined as UNENABLED the status of these remains CLOSED, UNENABLED.) CSFU is initiated automatically, immediately before the completion of CICS initialization. CICS opens each file with a separate OPEN request. If a user transaction starts while CSFU is still running, it can reference and open a file that CSFU has not yet opened; it does not have to wait for CSFU to finish.
RaOne
Registered Member
Posts: 27
Joined: Fri Aug 16, 2013 11:46 pm

Re: Does CICS takes care of open/close of files?

Post by RaOne »

Thanks Robert.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “CICS, Middleware and MQ Series.”