View previous topic :: View next topic
|
Author |
Message |
shikhasharma
New User
Joined: 16 Jan 2007 Posts: 11 Location: gurgaon
|
|
|
|
Hi
I need to add a functionality in my CICS program which will allow the program to open an online file as soon as it is triggered and in the end it should close the file again. Is there any way by which I can do this.. considering that open/close does not work in CICS. Please suggest. Its urgent. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
What do you mean by "online file"?
O. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
If you have access to the system programming interface of CICS you can issue SET FILE CLOSE and SET FILE OPEN commands in your code. What is the business requirement since throttlling down a multiuser system like CICS to make it run one thread at a time in this way is rarely a good idea? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Keep in mind that the SET FILE commands will operate only on Local files (IE: Files in the same region).
If the file is REMOTE, then a program must be written which will issue a Remote LINK (DPL) from the given AOR to the target region (which is usually a dedicated FOR). One problem is that user-loadlibs are not usually allowed to be defined to an FOR, in which case, the "older-than-dirt" (and still supported) CEMT Programmable Interface "DFHEMTP" can be used via DPL. However, "DFHEMTP" does not return a RETURN-CODE to indicate success/failure, which may be an issue.
Regards, |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
Quote: |
I need to add a functionality in my CICS program |
I just noticed you want run this from a CICS online program, the
vendor product I referenced in previous post, supports both Batch and CICS COBOL programs. |
|
Back to top |
|
|
shikhasharma
New User
Joined: 16 Jan 2007 Posts: 11 Location: gurgaon
|
|
|
|
Actually.. we defines one of the file in online region only for one particular transaction. Rest of the time, it should be closed. So, the buisness requirement is.. that whenever that transaction invokes the program, the program should automatically open the closed file and then close it at the end of the execution. Set command is to manually open/close a file in CICS. We will not be able to use it in this scenario. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
If only one transaction performs the file Open/Close sequence, then define this transaction to a special/unique tran class, limiting the maximum number of transactions active at any time (serialise) to ONE.
Otherwise, to ensure file integrity, the program would need to use ENQ/DEQ serialisation logic.
Regards, |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
Quote: |
Actually.. we defines one of the file in online region only for one particular transaction. Rest of the time, it should be closed. So, the buisness requirement is.. that whenever that transaction invokes the program, the program should automatically open the closed file and then close it at the end of the execution. Set command is to manually open/close a file in CICS. We will not be able to use it in this scenario |
Thats the beauty of the vendor software I'm suggesting, you can perform
cemt set command from your own COBOL logic. Tell your application
manager about it.
and no, I don't work for the vendor... |
|
Back to top |
|
|
|