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

Cobol code to check the status of an CICS file


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

New User


Joined: 21 Feb 2007
Posts: 72
Location: US

PostPosted: Fri Feb 19, 2010 1:56 pm
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: 2146
Location: At my coffee table

PostPosted: Fri Feb 19, 2010 2:13 pm
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: US

PostPosted: Fri Feb 19, 2010 3:17 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Feb 19, 2010 4:44 pm
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: US

PostPosted: Fri Feb 19, 2010 4:57 pm
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: 2146
Location: At my coffee table

PostPosted: Fri Feb 19, 2010 5:12 pm
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

Superior Member


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

PostPosted: Fri Feb 19, 2010 7:51 pm
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
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: 2146
Location: At my coffee table

PostPosted: Sat Feb 20, 2010 3:09 am
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 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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
Search our Forums:

Back to Top