I realize that you can get away with not chaining a new save area in this case, 
but it creates a booby trap for anybody who modifies the code.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
David Staudacher [[email protected]]
Sent: Monday, October 19, 2020 11:46 AM
To: [email protected]
Subject: Re: emptying a PDS

Given the specification to EMPTY a PDS, nothing is simpler than just 
reinitializing the directory.
Assemble this source and keep it around as a utility:
 *---------------------------------------------------------------------*
 * INITIALIZE PDS/PDSE TO EMPTY STATE                                  *
 *---------------------------------------------------------------------*
 PDSINIT CSECT
     SAVE  14
     LR    12,15
     USING PDSINIT,12
     OPEN  (PDS,OUTPUT) OPEN PDS
     STOW  PDS,,I            INITIALIZE PDS
     CLOSE PDS               CLOSE PDS
     RETURN 14               RETURN
 PDS DCB DDNAME=PDS,DSORG=PO,MACRF=W
     END PDSINIT

Run PDSINIT with this JCL:
// EXEC PGM=PDSINIT
//STEPLIB DD DISP=SHR,DSN=<your load library DSN>
//PDS DD DISP=SHR,DSN=S17666D.TEST.PDSE

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to