Hi,
I want to know whether a file is open or Closed thru JCL.
i.e. i shud give the file name as input thru JCL and after submitting it , i should get the output saying that " File1 is open/closed "
Please suggest a way to do it..
File status through JCL
Moderators: Frank Yaeger, DikDude, Moderator Group
JCL to find whether file is opened or closed.
using following code you can find whether given file is opened or closed.
Data will be printed in SYSPRINT as below.
In addition to above.. step will returns return code of 4.
if you want job to write above information to a dataset.. you output
dataset name for DD name SYSPRINT.
Code: Select all
//STEP1 EXEC PGM=IKJEFT1A
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
WHOHAS 'XXX.YYYY.ZZZZ.DATA'
//*
Code: Select all
WHOHAS 'XXX.YYYY.ZZZZ.DATA'
*** Not in use ***
if you want job to write above information to a dataset.. you output
dataset name for DD name SYSPRINT.
Regards,
Krishna
Facebook --> http://www.facebook.com/mainframegurukul
Connect with RAMESH KRISHNA REDDY --> http://www.linkedin.com/in/rameshkrishnareddy
Twitter --> https://twitter.com/mainframegurkul
http://www.mainframetutorials.com
Krishna
Facebook --> http://www.facebook.com/mainframegurukul
Connect with RAMESH KRISHNA REDDY --> http://www.linkedin.com/in/rameshkrishnareddy
Twitter --> https://twitter.com/mainframegurkul
http://www.mainframetutorials.com
-
- Active Member
- Posts: 52
- Joined: Wed Mar 25, 2009 11:56 pm
- Location: Banglore
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
@anuj...
When we face crisis calls ..
we just want to have a glance on all the important files whether any important file is closed.... and hence we need a report showing only the closed files..
as simple as that ..
@Krishna, thx for the reply ..
it has worked...wonderful.. thx a lot....
READY
WHOHAS 'K11716.ARU040.SETUP'
*** Not in use ***
When we face crisis calls ..
we just want to have a glance on all the important files whether any important file is closed.... and hence we need a report showing only the closed files..
as simple as that ..
@Krishna, thx for the reply ..
it has worked...wonderful.. thx a lot....
READY
WHOHAS 'K11716.ARU040.SETUP'
*** Not in use ***
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page