IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Open/ close an online file through CICS


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shikhasharma

New User


Joined: 16 Jan 2007
Posts: 11
Location: gurgaon

PostPosted: Thu Feb 12, 2009 2:47 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Feb 12, 2009 2:52 pm
Reply with quote

What do you mean by "online file"?

O.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 12, 2009 4:23 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Feb 12, 2009 6:09 pm
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Thu Feb 12, 2009 8:25 pm
Reply with quote

There is a vendor product that can answer your needs. You can write
cobol code to run cemt (or any other CICS transaction) and check
the response.

check this link
cicswiki.org/cicswiki1/index.php?title=How_do_I_interact_with_a_transaction_from_a_batch_program%3F#3rd_party_Vendor_Software
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Thu Feb 12, 2009 8:45 pm
Reply with quote

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
View user's profile Send private message
shikhasharma

New User


Joined: 16 Jan 2007
Posts: 11
Location: gurgaon

PostPosted: Thu Feb 12, 2009 9:04 pm
Reply with 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.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Feb 12, 2009 9:38 pm
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Thu Feb 12, 2009 10:18 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Using API Gateway from CICS program CICS 0
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top