z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example: Using ALLOCATE and OCOPY

z/OS UNIX System Services User's Guide
SA23-2279-00

  1. Using the ALLOCATE command to associate an existing z/OS UNIX file with the ddname specified in the DDNAME keyword, user TURBO could enter:
    ALLOCATE DDNAME(OPNWORK) PATH('/u/turbo/wkld/totals/oct17')
             PATHOPTS(ORDWR,OAPPEND) PATHDISP(KEEP,KEEP)
    In this example:
    • The file already exists, and PATHOPTS(ORDWR,OAPPEND) indicates that the file owner has read/write access to the file and the owner's data should be written at the end of the file.
    • PATHDISP(KEEP,KEEP) indicates that the file will be saved in case of normal or abnormal termination.
  2. Using the ALLOCATE command to associate the output data set with the ddname specified in the DDNAME keyword, user TURBO could enter:
    ALLOCATE DDNAME(MVSWORK) DSNAME('TURBO.WORKLOAD.TOTALS(OCT17)') OLD
    where the DDNAME keyword specifies the ddname. OLD indicates that this is an existing data set and others cannot access the data set while the system is writing to it.

    Tip: For an ALLOCATE, you can enter the data set name more simply as DSNAME(WORKLOAD.TOTALS(OCT17))—without the user ID. (TSO/E automatically prefixes the data set name with your user ID if you do not enclose the name in quotes.) For JCL, you need the user ID.

  3. TURBO then enters the OCOPY command, using ddnames, to copy the z/OS UNIX file to an MVS™ data set:
    OCOPY INDD(OPNWORK) OUTDD(MVSWORK) TEXT CONVERT(YES) PATHOPTS(USE)
    PATHOPTS(USE) indicates that TURBO wants to use the PATHOPTS specified on the ALLOCATE command.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014