Trying to delete/define a VSAm, but VSAM is in use
Moderator: Moderator Group
Trying to delete/define a VSAm, but VSAM is in use
Hi all,
I've just a little problem with a VSAM.
I have a job that runs daily that tries to delete a VSAM, re-define it and then to do a repro.
Sometimes this job goes bad. The reason is that the delete statement fails because the "dataset is allocated to another job or user".
How can I tell with my jcl to wait until the dataset is free for the delete action?
I was thinking to use a repro with a dummy file before the delete/define actions but i don't know how to do it without deleting any record (I mean: I want to add a dummy file to the content of my VSAM, is it possible?) Doing so I think that my job will wait till the VSAM is free and in few seconds it will be deleted and re-defined.
Sorry for my bad english and thanks in advance for any suggestion
I've just a little problem with a VSAM.
I have a job that runs daily that tries to delete a VSAM, re-define it and then to do a repro.
Sometimes this job goes bad. The reason is that the delete statement fails because the "dataset is allocated to another job or user".
How can I tell with my jcl to wait until the dataset is free for the delete action?
I was thinking to use a repro with a dummy file before the delete/define actions but i don't know how to do it without deleting any record (I mean: I want to add a dummy file to the content of my VSAM, is it possible?) Doing so I think that my job will wait till the VSAM is free and in few seconds it will be deleted and re-defined.
Sorry for my bad english and thanks in advance for any suggestion
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
here is a list of JCL manuals. pick the one for your environment.
http://publibz.boulder.ibm.com/cgi-bin/ ... nd&FS=TRUE
http://publibz.boulder.ibm.com/cgi-bin/ ... nd&FS=TRUE
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
Many thanks dbz, but it is a very long list. Can you please confirm me if the statements below are correct?
Code: Select all
//*
//STEP0 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DDIN DD DUMMY
//DDOUT DD DSN=output,DISP=OLD
//SYSIN DD *
REPRO INFILE(DDIN) -
OUTFILE(DDOUT)
//*
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
IDCAMS REPRO
Following is the jcl which i am using.. .for repro... may be useful to you.
Code: Select all
//RAL5280F EXEC PGM=IDCAMS
//**********************************************************************
//INFILE DD DUMMY
//VSAMFILE DD DSN=ZSD.DEV.VSAM.SWR.$IAM,DISP=SHR,
// AMP=('BUFNI=1','BUFND=5')
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOU=*
//SYSIN DD *
REPRO INFILE(INFILE) -
OUTFILE(VSAMFILE)
//
Natarajan
Chennai
Chennai
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
No, you don't need to put "old" somwehre instead hereDr_Halo wrote: But I've not understood where I've to put DISP=OLD !
Code: Select all
//DDOUT DD DSN=output,DISP=OLD
Regards,
Anuj
Anuj
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
Guys, the OP said he has a
and did not own up to the fact that
when the delete step fails, the define will also,
we will attribute that to inexperience.
probably a disp=old in the repro step will create the necessary exclusivity, but I would have thought that disp=old on the dd statement of the idcams delete step would work,
but I am a little anal and do things up front.
- delete step
- define step
- repro step
and did not own up to the fact that
when the delete step fails, the define will also,
we will attribute that to inexperience.
probably a disp=old in the repro step will create the necessary exclusivity, but I would have thought that disp=old on the dd statement of the idcams delete step would work,
but I am a little anal and do things up front.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
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