Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Cobol code to check the status of an CICS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
ashok_uddaraju

New User


Joined: 21 Feb 2007
Posts: 72
Location: bangalore

PostPosted: Fri Feb 19, 2010 1:56 pm    Post subject: Cobol code to check the status of an CICS file
Reply with quote

Hi,

can someone please let me know the code or logic for testing if an online CICS file is opened and enabled.

Regards,
Ashok
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Feb 19, 2010 2:13 pm    Post subject:
Reply with quote


INQUIRE FILE(data-value)
ENABLESTATUS(cvda)
OPENSTATUS(cvda)
Back to top
View user's profile Send private message
ashok_uddaraju

New User


Joined: 21 Feb 2007
Posts: 72
Location: bangalore

PostPosted: Fri Feb 19, 2010 3:17 pm    Post subject:
Reply with quote

Code:
ID DIVISION.
PROGRAM-ID. COBTEST
DATA DIVISION.
PROCEDURE DIVISION.
    PERFORM 100-TEST-PARA.
100-TEST-PARA.
    EXEC CICS
      INQUIRE FILE('CPILOG')
      ENABLESTATUS(CVDA)
      OPENSTATUS(CVDA)
    END-EXEC.


Here my online file name is CPILOG. Can you please let me know if this would work ? Or esle can someone please put in the modified code?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Feb 19, 2010 4:44 pm    Post subject: Reply to: Cobol code to check the status of an CICS file
Reply with quote

Each CVDA must be a unique WS field, defined as PIC S9(09) COMP. This INQUIRE will only return the requested results when the file is LOCAL to the given region.

After issuing the API, you would check -

Code:

IF  OPEN-CVDA = DFHVALUE(OPEN)

IF  ENABLED-CVDA = DFHVALUE(ENABLED)

In the API, you could add the REMOTESYSTEM keyword, as a PIC X(04) WS field. If the value returned to this PIC X(04) is NOT SPACES, then the file is REMOTE and represents the SYSID of the REMOTE region.

Bill
Back to top
View user's profile Send private message
ashok_uddaraju

New User


Joined: 21 Feb 2007
Posts: 72
Location: bangalore

PostPosted: Fri Feb 19, 2010 4:57 pm    Post subject:
Reply with quote

Bill,

Can you give me the code here
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Feb 19, 2010 5:12 pm    Post subject:
Reply with quote

ashok_uddaraju wrote:
Can you give me the code here
He just did..... icon_rolleyes.gif
BTW, what is an's.e."?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Feb 19, 2010 7:51 pm    Post subject:
Reply with quote

CICS Guy wrote:
BTW, what is an's.e."?
Most probably, Software Engineer...icon_smile.gif
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Sat Feb 20, 2010 2:58 am    Post subject:
Reply with quote

The EXEC CICS INQUIRE command is often restricted
to CICS System programmers use only.

Requires a special param option when using
the CICS translator.

If you experience compile problems, you will need to
contact you System Support group.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat Feb 20, 2010 3:09 am    Post subject:
Reply with quote

Earl Haigh wrote:
The EXEC CICS INQUIRE command is often restricted to CICS System programmers use only.
Or the OP could just test the retun code on the READ/WRITE/etc for DISABLED and NOTOPEN..... icon_cool.gif
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 Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us