Page 1 of 1

Does CICS takes care of open/close of files?

Posted: Mon Jun 27, 2016 3:11 pm
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.

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

Posted: Mon Jun 27, 2016 7:05 pm
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.

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

Posted: Tue Jun 28, 2016 5:28 pm
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.

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

Posted: Tue Jun 28, 2016 6:31 pm
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.

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

Posted: Tue Jul 05, 2016 12:20 pm
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...

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

Posted: Tue Jul 05, 2016 6:48 pm
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.

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

Posted: Thu Nov 16, 2017 9:32 pm
by RaOne
Thanks Robert.