Trying to delete/define a VSAm, but VSAM is in use

Post your questions related to VSAM

Moderator: Moderator Group

Post Reply
Dr_Halo
Member
Posts: 7
Joined: Wed Mar 18, 2009 5:31 pm
Location: Italy

Trying to delete/define a VSAm, but VSAM is in use

Post by Dr_Halo » Wed Mar 18, 2009 5:50 pm

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 :D

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Mar 18, 2009 6:30 pm

disp=old ?
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Dr_Halo
Member
Posts: 7
Joined: Wed Mar 18, 2009 5:31 pm
Location: Italy

Post by Dr_Halo » Wed Mar 18, 2009 6:33 pm

Yes dbz, disp=old, but I'm not sure how to use it. Can you, please, write me an example?

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Mar 18, 2009 6:59 pm

here is a list of JCL manuals. pick the one for your environment.

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.

Dr_Halo
Member
Posts: 7
Joined: Wed Mar 18, 2009 5:31 pm
Location: Italy

Post by Dr_Halo » Wed Mar 18, 2009 7:29 pm

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)
//*

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Mar 18, 2009 8:04 pm

why are you disp=old on the new file. it is the old file, in the delete step, that you
have to exclusively allocate.

as far as your jcl, test it!.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

IDCAMS REPRO

Post by Natarajan » Thu Mar 19, 2009 12:57 pm

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

Dr_Halo
Member
Posts: 7
Joined: Wed Mar 18, 2009 5:31 pm
Location: Italy

Post by Dr_Halo » Thu Mar 19, 2009 2:15 pm

Yes it is the same for me. But I've not understood where I've to put DISP=OLD ! :(
Can you please help me?

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Mar 19, 2009 11:47 pm

Dr_Halo wrote: But I've not understood where I've to put DISP=OLD ! :(
No, you don't need to put "old" somwehre instead here

Code: Select all

//DDOUT    DD DSN=output,DISP=OLD  
check what Natarajan has used?
Regards,
Anuj

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Fri Mar 20, 2009 1:33 am

Guys, the OP said he has a
  • delete step
  • define step
  • repro step
the fact that he lied
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.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Sat Mar 21, 2009 8:14 am

Hi Dick,

Just went through again the first post . . .may be if he post us back all the steps he is concentrating on, some one will be around with a better suggestion . . .
Regards,
Anuj

Post Reply

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



Other References
Mainframe Tools and others