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
 
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: 2504
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 Identifying Interfaces in CICS/mainframe Ashishpanpaliya CICS 5 Fri Oct 13, 2017 3:21 pm
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

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