Does CICS takes care of open/close of files?
Does CICS takes care of open/close of files?
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.
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.
- Robert Sample
- Global Moderator
- Posts: 1900
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Does CICS takes care of open/close of files?
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?
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.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.
- Robert Sample
- Global Moderator
- Posts: 1900
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Does CICS takes care of open/close of files?
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?
Thanks for the confirmation. That's what I have observed but was not able to prove it with some reference document...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.
- Robert Sample
- Global Moderator
- Posts: 1900
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Does CICS takes care of open/close of files?
The manual is CICS Configuring
and the wording is
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
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.Code: Select all
CEMT SET FILE(filename) OPEN EXEC CICS SET FILE(filename) OPEN
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.
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