Creating a Process That Copies a File

About this task

This example creates a Process that copies a file from one z/OS node to another. The copy excludes all members that begin with DM. It allocates a data set on the destination node using the source file attributes. After the copy completes, a user notification is sent. The parameters are:

Parameter Value
PNODE CDZOS.NEW.YORK
SNODE CDZOS.CHICAGO
User ID to notify NYC6
File to copy NYC1.LINKLIB

Procedure

  1. Open a text editor (on a mainframe, create a new member in the PDS public process library dataset).
  2. Type a 1-8 character name for the Process. In this example, the Process is named PROCCOPY.
    PROCCOPY
  3. Type a few spaces, then type the PROCESS keyword and the PNODE parameter and values.
    PROCCOPY   PROCESS     PNODE=CDZOS.NEW.YORK
  4. Type some more spaces, then type a hyphen continuation mark and press RETURN.
    PROCCOPY   PROCESS     PNODE=CDZOS.NEW.YORK                    -
  5. Type spaces until you are under the PNODE keyword, then type SNODE parameter and value, followed by a hyphen continuation mark. Press RETURN.
    PROCCOPY   PROCESS     PNODE=CDZOS.NEW.YORK                    -
                           SNODE=CDZOS.CHICAGO                     -
  6. Under the SNODE keyword type the NOTIFY parameter followed by the user ID to notify upon Process completion. As this is the last parameter for the PROCESS keyword, do not add a continuation mark.

    Press Enter.

    PROCCOPY   PROCESS     PNODE=CDZOS.NEW.YORK                    -
                           SNODE=CDZOS.CHICAGO                     -
                           NOTIFY=NYC6
  7. Next we will add the COPY statement. Type a 1-8 character label for the statement, beginning in position one. In this example, the label is called STEP1.
    PROCCOPY   PROCESS     PNODE=CDZOS.NEW.YORK                    -
                           SNODE=CDZOS.CHICAGO                     -
                           NOTIFY=NYC6
    STEP1
  8. Type some spaces, then type the COPY FROM statement followed by an open parenthesis, the DSN parameter and value.
    PROCCOPY   PROCESS     PNODE=CDZOS.NEW.YORK                    -
                           SNODE=CDZOS.CHICAGO                     -
                           NOTIFY=NYC6
    STEP1      COPY FROM   (DSN=NYC1.LINKLIB
  9. Type some more spaces followed by a hyphen continuation mark and press RETURN.
    PROCCOPY   PROCESS     PNODE=CDZOS.NEW.YORK                    -
                           SNODE=CDZOS.CHICAGO                     -
                           NOTIFY=NYC6
    STEP1      COPY FROM   (DSN=NYC1.LINKLIB                     -
  10. Type some spaces followed by the EXCLUDE parameter.
    PROCCOPY   PROCESS     PNODE=CDZOS.NEW.YORK                    -
                           SNODE=CDZOS.CHICAGO                     -
                           NOTIFY=NYC6
    STEP1      COPY FROM   (DSN=NYC1.LINKLIB                     -
                           EXCLUDE=
  11. We want to exclude all members that begin with DM from the copy, so type (DM*) followed by a close parenthesis (to close the DSN parameter) and the hyphen continuation mark.
    PROCCOPY   PROCESS     PNODE=CDZOS.NEW.YORK                    -
                           SNODE=CDZOS.CHICAGO                     -
                           NOTIFY=NYC6
    STEP1      COPY FROM   (DSN=NYC1.LINKLIB                     -
                           EXCLUDE=(DM*))                        -
  12. Press RETURN to move to the next line. Type spaces until you are under FROM, then TYPE the TO parameter followed by the DSN to assign the file on the destination node.
    PROCCOPY   PROCESS     PNODE=CDZOS.NEW.YORK                    -
                           SNODE=CDZOS.CHICAGO                     -
                           NOTIFY=NYC6
    STEP1      COPY FROM   (DSN=NYC1.LINKLIB                     -
                           EXCLUDE=(DM*))                        -
                     TO    (DSN=CHI6.NEW.LINKLIB)
  13. Save the file to a library that can be accessed by IBM® Connect:Direct®.
  14. Use the IBM Connect:Direct SUBMIT command to submit the Process.