Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Open/ close an online file through CICS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Open/ close an online file through CICS
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: 2360
Location: Israel

PostPosted: Thu Feb 12, 2009 2:52 pm    Post subject:
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: 8152
Location: East Dubuque, Illinois, USA

PostPosted: Thu Feb 12, 2009 4:23 pm    Post subject:
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: 2504
Location: Atlanta, Georgia, USA

PostPosted: Thu Feb 12, 2009 6:09 pm    Post subject: Re: Open/ close an online file through CICS
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    Post subject:
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
http://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    Post subject:
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    Post subject: Reply to: Open/ close an online file through CICS
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: 2504
Location: Atlanta, Georgia, USA

PostPosted: Thu Feb 12, 2009 9:38 pm    Post subject: Reply to: Open/ close an online file through CICS
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 0 Mon Sep 18, 2017 4:31 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Reply MQ open error Vignesh Sid COBOL Programming 5 Thu Sep 07, 2017 6:02 pm
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us