PDSCOPY Procedure: z/OS

Copies partitioned data sets from disk to disk, disk to tape, tape to tape, or tape to disk.
z/OS specifics: All

Syntax

PROC PDSCOPY INDD=file-specification OUTDD=file-specification <options > ;
EXCLUDE member-name-1 <. . . member-name-n > ;
SELECT member-name-1 <. . . member-name-n > ;

Details

Overview of PROC PDSCOPY

The PDSCOPY procedure can be used to copy an entire partitioned data set, or you can specify which members you want to copy. This procedure cannot be used to copy extended partitioned data sets (PDSEs). PROC PDSCOPY is useful for backing up source libraries and load module libraries to tape. If you use PROC PDSCOPY to copy a PDS to tape, then you must also use it if you want to copy that PDS back to disk. However, you can use either PROC PDSCOPY or other copy utilities to copy that tape to another tape.
When libraries are moved between disks that have different optimal block sizes, PROC PDSCOPY can be used to reblock the libraries. PROC PDSCOPY handles overlay programs and alias names. It also sets up the RLD count fields that are used by the FETCH program.
When a PDS contains load modules, it generally requires 13% to 18% less disk space after being copied by PROC PDSCOPY, because PROC PDSCOPY uses free space on a partially filled track to store records. The linkage editor constructs records that do not fit on a partially used track.
The PDSCOPY procedure does not copy scatter-loaded modules.
If errors are encountered during PDSCOPY processing, the return code for the job step is set to 8.

PROC PDSCOPY Statement

Syntax of the PROC PDSCOPY Statement

PROC PDSCOPY INDD=file-specification OUTDD=file-specification <options> ;

Required Arguments

INDD=file-specification
specifies either the fileref or the physical filename (enclosed in quotation marks) of the library to copy.
OUTDD=file-specification
specifies either the fileref or the physical filename (enclosed in quotation marks) of the output partitioned data set.

Optional Arguments

Some of the options that can appear in the PROC PDSCOPY statement apply to both source libraries and load module libraries. Others apply only to load module libraries. The following options apply to both source libraries and load module libraries:
  • ALIASMATCH=TTR
  • BLKSIZE=
  • INTAPE
  • NEWMOD
  • NOALIAS
  • NOREPLACE
  • OUTTAPE
  • SHAREINPUT
The following options apply only to load module libraries:
  • ALIASMATCH=BOTH|EITHER|NAME
  • DC
  • DCBS|NODCBS
  • MAXBLOCK=
  • NE
  • NOTEST
All the options that can appear in the PROC PDSCOPY statement are discussed in this section. In the discussion, the term member refers to both source library members and to load modules. The term module refers only to load modules.
ALIASMATCH=BOTH | EITHER | NAME | TTR
specifies how to match aliases with main members to determine whether they represent the same member.
BOTH
specifies that both the TTR (relative track and record) values and the names must match in order for a main module to be considered a match.
EITHER
specifies that a match for either the TTR value or the name is sufficient to identify the main module that corresponds to an alias. If more than one main module directory entry matches, it is impossible to predict which one is used.
NAME
specifies that the main module name in the directory entry for the alias (at offset 36) is compared with main module names to find a match. The alias is assumed to represent the same module as the main module that has the matching name. When you specify ALIASMATCH=NAME, the TTR values do not need to match.
A situation in which names match even though TTR values do not match occurs when the main module is originally link edited specifying the alias names, and then link edited again without specifying them. In this case, the directory entries for the aliases still point to the old version of the module (that is, to a back-level version). Because of this situation, you should consider carefully whether to use the ALIASMATCH=NAME option or the NEWMOD option. ALIASMATCH=NAME updates the aliases to point to the current version of the main module rather than to the back-level version. The NEWMOD option causes the older version of the module to copy. Another alternative is to use TTR matching and not to copy the aliases when they are, in fact, obsolete names.
TTR
specifies that TTR values are compared. TTR is the default. An alias is assumed to represent the main member that has the same TTR value. If the TTR values match, then the directory entry for the main member and the alias currently point to the same place in the data set.
For load modules, the most common situation in which TTR values might match, but names might not match, occurs when the main module was renamed (for example, by using ISPF option 3.1) after the aliases were created. The alias directory entries can still contain the old main module name.
Whichever method you use, unmatched aliases are not copied to the output file unless you specify the NEWMOD option. See the information about NEWMOD below. Matched aliases in the output file always point to the main module to which they were matched (that is, they have the same TTR values), even if the TTR values were different in the input file (which might occur if ALIASMATCH=NAME or ALIASMATCH=EITHER was used). When modules are matched using the TTR values (that is, when TTR or EITHER was specified), the main module name in alias directory entries is changed in the output file.
BLKSIZE=block-size
specifies the maximum block size to use for reblocking the copied load modules on the output device. If the BLKSIZE= option is omitted, the default depends on the type of the output device and on the data set type:
  • If output is to tape, the default is 32,760.
  • If output is in tape (sequential) format on disk (that is, when the OUTTAPE option is used), the default is either the device track size or 32,760, whichever is less.
  • If output is to disk, the default depends on the device type. However, it is never greater than 18K unless you use the MAXBLOCK= option. See the information about MAXBLOCK below. In addition, the default cannot exceed the device track size or 32,760, whichever is less.
  • Unless the NODCBS option (described later) is specified and the output data set is a partitioned data set on disk, the default value is reduced to the data set control block (DSCB) block size of the partitioned data set, if that is smaller.
For tape (sequential) format output, the specified block size cannot be less than 1.125 times the maximum input device block size, nor greater than 32,760. For disk output, the specified block size cannot be less than 1,024.
DC
specifies that load modules that are marked downward compatible (that is, modules that can be processed by linkage editors that were used before z/OS) are eligible for processing. After they are copied by PROC PDSCOPY, the load modules are not marked DC in their directory entry because PROC PDSCOPY does not produce downward compatible load modules nor does it preserve their attributes. If you do not specify the DC option and you attempt to copy load modules marked DC, PROC PDSCOPY issues an error message.
DCBS | NODCBS
tells SAS whether to preserve the data control block (DCB) characteristics of the output partitioned data set on disk. If NODCBS is specified, the data control block (DCB) characteristics of the output partitioned data set on disk can be overridden. The default value is DCBS.
If the NODCBS option is specified, PROC PDSCOPY changes the DSCB (data set control block) block size of the output partitioned data set to the maximum permissible block size for the device. Otherwise, the maximum permissible value of the BLKSIZE= option is the current block size value from the DSCB, and the DSCB block size is not changed.
Using the NODCBS option might enable PROC PDSCOPY to block output load modules more efficiently. However, changing the DSCB block size could cause problems when the data set is moved, copied, or backed up by a program other than PROC PDSCOPY, particularly if your installation has more than one type of disk drive. Consult your systems staff before specifying NODCBS.
INTAPE
specifies that the INDD= library is in tape (sequential) format. The INTAPE option is assumed if a tape drive is allocated to the input data set.
MAXBLOCK=block-size | MAXBLK=block-size
enables you to override the limitation of 18K on the block size of text records in the output library. (The value of BLKSIZE must be greater than or equal to the value of MAXBLOCK in order to get text records at MAXBLOCK size.) If the value of MAXBLOCK is not specified, then the maximum block size for text records is 18K; this block size is the largest text block that can be handled by the FETCH program in many operating environments. You can specify a block size greater than 18K for text records, but doing so might cause copied modules to ABEND with an ABEND code of 0C4 or 106-E when they are executed. You should use this parameter only if you are sure that your operating environment (or TP monitor) FETCH program supports text blocks that are larger than 18K. For example, CICS and z/OS FETCH programs support text blocks that are larger than 18K.
NE
specifies that the output library should not contain records that are used in the link editing process. Although programs in the output library are executable, they cannot be reprocessed by the linkage editor, nor can they be modified by the AMASPZAP program. Using the NE option can reduce the amount of disk space that is required for the output library.
NEWMOD
specifies that aliases that do not match a main member are to be copied as main members rather than being marked as aliases in the output file. The directory entry in the output file is reformatted to main member format. See the ALIASMATCH option for a description of how aliases are matched with main members. If you do not specify the NEWMOD option, unmatched aliases are not copied to the output file.
NOALIAS | NOA
prevents automatic copying of all aliases of each member that you have selected for copying. Any aliases that you want to copy must be named in the SELECT statement. If you select only an alias of a member, the member (that is, the main member name) is still automatically copied, along with the selected alias.
NOREPLACE | NOR
copies only members in the INDD= library that are not found in the OUTDD= library. That is, members or aliases that have the same name are not replaced.
NOTEST
deletes the symbol records produced by the assembler TEST option from the copied load modules. Using the NOTEST option can reduce the amount of disk space that is required for the output library by 10% to 20%.
OUTTAPE
specifies that the OUTDD= library is to be in tape (sequential) format. The OUTTAPE option is assumed if a tape drive is allocated to the output data set.
SHAREINPUT | SHAREIN
specifies that the INDD= library is to be shared with other jobs and TSO users. SHAREINPUT is the default for PDSCOPY when the INDD= library is enqueued for shared control (DISP=SHR). This value means that the INDD= library is shared with ISPF and the linkage editor rather than being enqueued exclusively. This sharing makes it possible for more than one person to use an INDD= library simultaneously. (The OUTDD= library is always enqueued for exclusive control against ISPF and the linkage editor. Therefore, it cannot be changed while PROC PDSCOPY is processing it.)

EXCLUDE Statement

EXCLUDE member-name-1 <. . . member-name-n > ;
Use this statement if you want to exclude certain members from the copying operation. The EXCLUDE statement is useful if you want to copy more members than you want to exclude. All members that are not listed in EXCLUDE statements are copied. You can specify more than one member in an EXCLUDE statement, and you can specify as many EXCLUDE statements as necessary.
If you follow a specification in the EXCLUDE statement with a colon (:), then all members whose names begin with the characters preceding the colon are excluded.
Note: You cannot use both the SELECT statement and the EXCLUDE statement in one PROC PDSCOPY step.

SELECT Statement

SELECT member-name-1 <. . . member-name-n > ;
Use this statement to specify the names of members to copy if you do not want to copy the entire library. You can specify more than one member in a SELECT statement, and you can specify as many SELECT statements as necessary.
If you follow a specification in the SELECT statement with a colon (:), then all members whose names begin with the characters preceding the colon are copied. In the following example all members whose names begin with the characters FCS are copied:
select fcs:;
Note: You cannot use both the SELECT statement and the EXCLUDE statement in one PROC PDSCOPY step.

Output Data Set

The PDSCOPY procedure produces an output partitioned data set on disk or on tape. The output data set contains copies of the requested members of the input partitioned data set.
If you use PROC PDSCOPY to copy partitioned data sets that contain source members, then the RECFM and LRECL of the output data set must match the RECFM and LERECL of the input data set. If they differ, an error message is displayed. The BLKSIZE values for the input and output data sets do not have to be the same, however.

Usage Notes

If a member that you specified in a SELECT statement does not exist, PROC PDSCOPY issues a warning message and continues processing.
PROC PDSCOPY enqueues the input and output data sets using the SPFEDIT and SPFDSN QNAMEs.
If a data set has a name that was assigned by using the FILENAME statement, the ENCODING value of the FILENAME statement is ignored when the data set is processed by PROC PDSCOPY.

Output

The PDSCOPY procedure writes the following information to the SAS log:
  • INPUT and OUTPUT, the data set names and volume serials of the input and output libraries
  • MEMBER, a list of the members copied
  • ALIAS, the members' aliases, if any
  • whether the copied members replaced others members of the same name
  • whether a selected member or alias was not copied and a note explaining why not.
If the output device is a disk, PROC PDSCOPY also writes the following information next to each member name:
  • TRACKS, the size of the member, in tenths of tracks
  • SIZE, the number of bytes in the member that was copied (in decimal notation).

Example: Copying Members Using the PDSCOPY Procedure

The following example copies all members and aliases that start with the letters OUT. In this example, the alias must match the main member both by name and by TTR in order for the alias to be copied.
filename old 'userid.mvs.output' disp=shr;
filename new 'userid.mvs.output2' disp=old;
proc pdscopy indd=old outdd=new aliasmatch=both
      shareinput;
   select  out:;
run;
The following output displays the results:
PDSCOPY Procedure Example
 1    filename old 'userid.mvs.output' disp=shr;
 2    filename new 'userid.mvs.output2' disp=shr;
 3
 4    proc pdscopy indd=old outdd=new aliasmatch=both shareinput;
 5       select out:;
 6    run;
     SAS PROC PDSCOPY Version 9.00   04/24/99
     INPUT  DSNAME=USERID.MVS.OUTPUT  VOL=SER=XXXXXX
     OUTPUT DSNAME=USERID.MVS.OUTPUT2  VOL=SER=XXXXXX
     MEMBER     TRACKS       SIZE
       ALIAS
     OUT1601     2.6        40019 replaced
     OUT1602    10.6       165519 replaced
     OUT1603    53.3       829081 replaced
     TRACKS USED    67.0
            UNUSED   8.0
            TOTAL   75.0
     EXTENTS         5