I faced this interview questions. Please share your thoughts/answer on this:
Why don't CICS provides file open and close like in COBOL?
I answered that at the time when CICS region goes up, it will open all the files. We can change that using CEMT I FILEName. But I think I was not able to give a good answer. And that guy was not satisfied with my explanation. Can anyone here advise me with a good answer.
open and close file in CICS.
- Robert Sample
- Global Moderator
- Posts: 1898
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: open and close file in CICS.
CICS handles files as a resource available to every program, not just the one program. As such CICS handles file opens and closes -- you can specify to open the file when CICS comes up or on first reference. You don't put file definition and open / close logic in a CICS program first because CICS is handling them, and second because file open and close logic involves operating system functions that would interfere with the way CICS works.
-
- New Member
- Posts: 3
- Joined: Mon Jan 19, 2015 9:44 am
Re: open and close file in CICS.
Thanks Robert.Robert Sample wrote:CICS handles files as a resource available to every program, not just the one program. As such CICS handles file opens and closes -- you can specify to open the file when CICS comes up or on first reference. You don't put file definition and open / close logic in a CICS program first because CICS is handling them, and second because file open and close logic involves operating system functions that would interfere with the way CICS works.
Can you please elaborate on this: second because file open and close logic involves operating system functions that would interfere with the way CICS works?
- Robert Sample
- Global Moderator
- Posts: 1898
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: open and close file in CICS.
If you compile a batch COBOL program with file opens and closes, then look at the generated pseudo-assembler code, you will see an OPEN generates an SVC 13 and a CLOSE generates an SVC 14. These are Supervisor Calls to operating system routines. When I was learning CICS, I was told that CICS will not function properly if SVC calls are made not under its control -- potentially even bringing down the entire region.
-
- New Member
- Posts: 3
- Joined: Mon Jan 19, 2015 9:44 am
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