On Sun, 27 Jun 2010 15:00:14 -0400, Thompson, Steve
<[email protected]> wrote:

>I just have to ask this one question.
>
>How difficult is it to get the number of directory blocks from a PDS in
>a _____ program (where the blank can be filled in with COBOL, PL/1,
>REXX, etc., but not HLASM/ASM) and then open the data set with RECFM=U
>and then write an initial directory block followed by n empty blocks?
>
>With that question asked, if it is not so difficult, wouldn't that allow
>you to clear a PDS right rapidly? The only access you would have to have
>for the data set is update, because you aren't deleting it or
>[re-]allocating it.
>

Even easier than you wrote...

/* rexx - "zero" a PDS Directory */                                        
ARG dsn                                                                  
"ALLOC F(PDSDIR) DA("dsn") SHR REUSE RECFM(F)", /* pds directory     */  
      "DSORG(PS) LRECL(256) BLKSIZE(256)"                                
"EXECIO 1 DISKRU PDSDIR (STEM DIR."            /* read pds directory */  
                                               /* for update         */  
DIR.1 = '000EFFFFFFFFFFFFFFFF'x                /* End of Directory   */  
"EXECIO 1 DISKW PDSDIR (STEM DIR. FINIS"       /* Rewrite Directory  */  
"FREE F(PDSDIR)"                                                         
Exit                                                
                     

Obviously it won't work with PDSE.

--
Mark Zelden - Zelden Consulting Services - z/OS, OS/390 and MVS       
mailto:[email protected]                                          
Mark's MVS Utilities: http://home.flash.net/~mzelden/mvsutil.html 
Systems Programming expert at http://expertanswercenter.techtarget.com/

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