Chapter Contents |
Previous |
Next |
PDS |
OS/390 specifics: | all |
Syntax | |
Details | |
PROC PDS Statement | |
DELETE Statement | |
CHANGE Statement | |
EXCHANGE Statement | |
Usage Note | |
Example of Deleting and Renaming Members with the PDS Procedure |
Syntax |
PROC PDS DDNAME=file-specification
<options>;
|
Details |
PROC PDS operates on the directory of a partitioned data set to list, delete, and rename members and aliases. (Partitioned data sets are not the same as SAS data libraries.) When members are deleted or renamed, PROC PDS updates the directory of the partitioned data set. Also, unless NOLIST is specified, PROC PDS writes an updated listing of the PDS member names to the SAS log.
PROC PDS operates with full capabilities on both extended partitioned data sets (PDSEs) and standard partitioned data sets (PDSs).
PROC PDS Statement |
PROC PDS DDNAME=file-specification <options>; |
The following options can appear in the PROC PDS statement:
DELETE Statement |
DELETE member-1 <. . . member-n >; |
When a specification in the DELETE statement is followed by a colon (:), all members whose names begin with the characters preceding the colon are deleted. For example, when the following statement is executed, PROC PDS deletes all members whose names begin with the characters PRGM:
delete prgm:;
CHANGE Statement |
CHANGE old-name-1 =new-name-1 < . . . old-name-n=new-name-n > ; |
filename loadlib 'my.pgm.lib '; proc pds ddname=loadlib; change testpgm=prodpgm; run;
If multiple members have names that begin with the same sequence of characters and you want to change all of the names so that they begin with a different sequence, use a colon (:) after old-name and new-name. Here is an example:
change exam:=test:;
All of the members whose names began with the characters EXAM will subsequently have names beginning with the characters TEST.
Note: If changing the name of a member would make the name
the same as that of an existing member, then the member is not renamed and
a note is written to the SAS log.
It is not necessary for the lengths of the character sequences that precede the colon to match. For example, the following statement is valid:
change am:=morn:;
However, if a new name is too long, then a note is written to the SAS log and no change is made.
EXCHANGE Statement |
EXCHANGE name-1=other-name-1 < . . . name-n=other-name-n > ; |
proc pds ddname='my.pgm.lib'; exchange a=z; run;
If multiple members have names that begin with the same sequence of characters and you want to exchange that sequence with the sequence from another group of data sets, use a colon (:) after name and other-name. For example, after the following statement is executed, all data sets whose names began with ABC will begin with DEFG. In addition, all of the data sets whose names began with DEFG will begin with ABC, as shown:
exchange abc:=defg:;
It is not necessary for the lengths of the sequences of characters that precede the colons to match. However, if a new name is too long, then a note is written to the SAS log and no change is made.
Usage Note |
Unlike other SAS procedures that deal with partitioned data sets (for example, PROC PDSCOPY and PROC SOURCE), PROC PDS does not make any distinction between a member name and an alias, other than to report which names in the PDS directory are aliases for which members. If an alias is renamed, it is still an alias. PROC PDS allows you to delete a member that has aliases in the PDS directory, but then other procedures (PROC PDSCOPY, for example) cannot process the aliases.
Example of Deleting and Renaming Members with the PDS Procedure |
This example writes the names of the members of USERID.MVS.OUTPUT to the SAS log and then generates a second listing showing the member changes and deletions that are specified by the second PROC step. The results are shown in Deleting and Renaming Members with the PDS Procedure.
filename pdstest 'userid.mvs.output'; proc pds ddname=pdstest; run; proc pds ddname=pdstest; delete tempout tempout2; change mem=out1603; run;
Deleting and Renaming Members with the PDS Procedure
1 filename pdstest 'userid.mvs.output'; 2 3 proc pds ddname=pdstest; 4 run; SAS PROC PDS VERSION 8.00 04/27/99 DSNAME=USERID.MVS.OUTPUT VOL=SER=XXXXXX Members (aliases) MEM OUT1601 OUT1602 TEMPOUT TEMPOUT2 Tracks Used 1.8 Unused 1.2 Total 3.0 Extents 1 Directory Blks 11 Blocks Used 1 5 6 proc pds ddname=pdstest; 7 delete tempout tempout2; 8 change mem=out1603; 9 run; DSNAME=USERID.MVS.OUTPUT VOL=SER=XXXXXX Members (aliases) MEM OUT1601 OUT1602 OUT1603 Tracks Used 1.8 Unused 1.2 Total 3.0 Extents 1 Directory Blks 11 Blocks Used 1 |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.