Name

copypds — copy a PDS(E) to another PDS(E) with member selection

Synopsis

copypds [OPTION]... //source.dataset.name //target.dataset.name
copypds [OPTION]... //source.dataset.name(member_filter) //target.dataset.name
copypds -h
copypds -v
    

Description

This z/OS Co:Z utility command makes a copy of a PDS or PDSE using the COPYGROUP operation of IBM's IEBCOPY utility. If the target PDS(E) does not exist, it will be created with allocation parameters like the source. If the target PDS(E) exists, members with the same name can be replaced or skipped, based on the options set.

source.dataset.name is either an MVS PDS or PDSE data set, preceded by '//'.

target.dataset.name may already exist. If it does, it must be a PDS or PDSE. If it does not exist, it will be allocated like source.dataset.name.

If member_filter is given, just the matching members from the source data set will be copied.

  • It must follow the IEBCOPY COPYGROUP member name filter pattern syntax

  • It cannot be specified if the -M switch is specified

In a shell you will need to quote "//source.dataset.name(member_filter)" since ( and ) are meta characters.

The -M switch can be specified multiple times, or will read from stdin if the argument is "-" .

If the command fails during the IEBCOPY invocation, the IEBCOPY utility messages will be written to stderr. These messages will be emitted during a successful run if the logging level is set to Info or more verbose.

Options

-h

display this help and exit.

-L logging-options

A comma-separated list of options to control logging and tracing.

M | A | C | E | W | N | I | D | T | F

Logging threshhold: eMergency, Alert, Critical, Error, Warning, Notice (default), Info, Debug, Trace, Fine.

t

Prefix log messages with a system timestamp

e

Include consumed cpu time in log messages

f=filename

Messages are logged to filename on the server instead of stderr. If not fully qualified, the file is written to the user's home directory on the server.

component=M|A|C|E|W|N|I|D|T|F

Set the logging threshold for a specific component. Specify only at the request of product support personnel.

-M

custom IEBCOPY member SELECT or EXCLUDE MEMBER statement. This switch can be specified multiple times, or if the argument is a hyphen "-", the control statements will be read from stdin.

-r

both the source and target data set names are prefixed with MVS userid.

-R y|n|w

If y, replace like named members if the target data set exists. If n, do not replace like named members and set RC=0 even if there was a conflict. If w, do not replace and set RC=4 if there was a conflict. -Rw is the default.

-T

display the IEBCOPY command details without executing.

-v

display the current version and exit.

Examples

  1. This example copies all of the members of a PDSE to a new PDSE

    $ copypds //goetze.cozexits.loadlib //goetze.myexits.loadlib
    
  2. This example copies the members of a PDSE with names starting with the characters CZP to an existing PDSE.

    $ copypds -Ry "//goetze.cozexits.loadlib(CZP*)" //goetze.myexits.loadlib
    
  3. This example uses the -T option (test mode) that shows what the IEBCOPY invocation will look like without running the utility.

    The example also shows the use of -M- option to read the custom member selection control statements from stdin.

    $ copypds -TRy -M- //goetze.cozexits.loadlib //goetze.myexits.loadlib <<EOB
    > select member=(czchk*)
    > exclude member=(czchkip)
    > EOB
    
    //COPYPDS  EXEC PGM=IEBCOPY,PARM='WORK=2M,RC4NOREP'
    //SYSUT1   DD DSN=GOETZE.COZEXITS.LOADLIB,DISP=SHR
    //SYSUT2   DD DSN=GOETZE.MYEXITS.LOADLIB,DISP=OLD
    //SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=121)
    //SYSIN    DD *
     COPYGROUP INDD=((SYSUT1,R)),OUTDD=SYSUT2
     SELECT MEMBER=(CZCHK*)
     EXCLUDE MEMBER=(CZCHKIP)
    
    //
    
  4. This example is the same as the above example replacing the -T option with the -LI option (log at the INFO level) which runs the IEBCOPY utility and displays the messages.

    $ copypds -VRy -M- //goetze.cozexits.loadlib //goetze.myexits.loadlib <<EOB
    > select member=(czchk*)
    > exclude member=(czchkip)
    > EOB
    
    copypds[N]: Iebcopy: 1                                         IEBCOPY MESSAGES AND CONTROL STATEMENTS
    copypds[N]: Iebcopy: -IEB1135I IEBCOPY  FMID HDZ2230  SERVICE LEVEL UA92265  DATED 20170618 DFSMS
    copypds[N]: Iebcopy:  IEB1035I GOETZE    *OMVSEX  12:20:54 WED 21 OCT 2020 PARM='WORK=2M'
    copypds[N]: Iebcopy: - COPYGROUP INDD=((SYS00010,R)),OUTDD=SYS00011
    copypds[N]: Iebcopy:   SELECT MEMBER=(CZCHK*)
    copypds[N]: Iebcopy:   EXCLUDE MEMBER=(CZCHKIP)
    copypds[N]: Iebcopy: 0IEB1013I COPYING FROM PDSE  INDD=SYS00010 VOL=VPWRKC DSN=GOETZE.COZEXITS.LOADLIB
    copypds[N]: Iebcopy:  IEB1014I           TO PDSE OUTDD=SYS00011 VOL=VPWRKB DSN=GOETZE.MYEXITS.LOADLIB
    copypds[N]: Iebcopy:  IGW01264I TOTAL PRIMARY NAMES: 4, FILTER PATTERN MATCHES: 2
    copypds[N]: Iebcopy:  IGW01552I MEMBER CZCHKCMD HAS BEEN COPIED   AND REPLACED
    copypds[N]: Iebcopy:  IGW01552I MEMBER CZCHKPWD HAS BEEN COPIED   AND REPLACED
    copypds[N]: Iebcopy:  IGW01550I 2 OF 2 SPECIFIED  MEMBERS WERE COPIED
    copypds[N]: Iebcopy:  IEB147I END OF JOB - 0 WAS HIGHEST SEVERITY CODE
    

Saint Charles, Missouri
info@coztoolkit.com
+1 636.300.0901

Copyright© 2009 - 2023 Dovetailed Technologies, LLC. All rights reserved. Co:Z® is a registered trademark and Co:Z Toolkit™ is a trademark of Dovetailed Technologies, LLC.

Saint Charles, Missouri
info@coztoolkit.com
+1 636.300.0901

Copyright© 2009 - 2023 Dovetailed Technologies, LLC. All rights reserved. Co:Z® is a registered trademark and Co:Z Toolkit™ is a trademark of Dovetailed Technologies, LLC.