On Wed, 23 May 2007 02:19:19 -0400, Doug Fuerst wrote:

>Actually, this was recently explained to me by IBM. (MOD,DELETE)
>indicates that the dataset might exist, if it does, then MOD it. If
>it does not, then create it and then delete it. But SPACE would be
>required in any case where the dataset did not exist. This would also
>be true for (MOD,KEEP). In this case, if the dataset did not exist it
>would be created, and KEPT, but not cataloged.  SPACE would be
>required if the dataset did not exist.
>

The SPACE parameter is required, not necessarily real space on a volume. I 
use this DD in an IEFBR14 step to clean up possibly pre-existing files of any 
kind:

//SYSUT1   DD  DSN=Your.Data.Set.Name,
//             DISP=(MOD,DELETE,DELETE),       
//             UNIT=(SYSDA,,DEFER),            
//             SPACE=(TRK,(0,0),RLSE)          

It follows the rules for if the dataset exists, it will try to extend it. If it 
doesn't 
exist, it will create it and delete it with zero space allocated. If it exists 
on 
any device other than disk, it will still delete it since the DEFER parameter 
keeps a UNIT from being allocated until the file is actually opened and a BR14 
will never actually open the file.

I believe Gil's example will also fail if the file does not exist and he 
actually 
tries to write to it without a SPACE parameter. If the file does not exist and 
you don't at least open and close the file, no VTOC record will be written to 
the disk.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to