Copy a File to an Existing zOS Sequential Data Set

Copy a File to an Existing z/OS Sequential Data Set

These examples copy, in text mode, one sequential file to another. This is the simplest form of data transfer.

DD File System


//S1 EXEC UDMPRC

//APOUT DD DSN=APP.DATA.DAILY,DISP=SHR

//UNVSCR DD *

set  _echo=yes

set  _halton=warn

open  unix=sol9 user=top098 pwd=p100m

filesys  local=dd

cd  unix=/opt/app/data

mode  type=text

copy  unix=data10.txt local=APOUT

quit  /*

For this first z/OS example, the following is a line-by-line explanation:

  1. Line 1 turns on command echo, which results in each command being written prior to processing.
  2. Line 2 sets the error condition value on which script processing halts. Any error greater than or equal to warn halts script processing.
  3. Line 3 opens a session between the local UDM Manager and a remote UDM server running on host sol9. The host sol9 is given the logical name of unix. The open command also provides user credentials for the UDM server to verify and, if successfully verified, specifies the user ID with which the UDM server executes.
  4. Line 4 changes the local file system from the default of DSN to DD. The file system type dictates the syntax and semantics of file specifications, such as in the copy command.
  5. Line 5 changes the current directory of the UDM server unix running on host sol9.
  6. Line 6 changes the transfer mode type from binary (the default) to text. Text mode transfers will translate between code pages (for example, ASCII and EBCDIC) and process the end-of-line characters.
  7. Line 7 is the copy command that actually moves the data between systems. It copies file data10.txt on server unix to the local UDM Manager ddname APOUT. Recall that line 4 sets the local file system type to DD; hence, APOUT is referencing a ddname.
  8. Line 8 executes the quit command, which closes all sessions and exits UDM with the highest exit code set.

DSN File System

//S1 EXEC UDMPRC

//UNVSCR DD *

set  _echo=yes

set  _halton=warn

open  unix=sol9 user=top098 pwd=p100m

cd  unix=/opt/app/data

mode  type=text

attrib  local createop=replace

copy  unix=data10.txt local='app.data.daily'

quit  /*

The DSN file system example is basically the same as the DD file system example, with these changes:

  • Removal of the filesys command (line 4 in the DD file system example), since the default file system for the z/OS manager is DSN.
  • Addition of line 6, which sets the local attribute createop. createop controls how a file is created. By default, its value is new, indicating that only new files are created and existing files are not written over (replaced). In this example, the value is being set to replace, which specifies that if the file exists, it should be replaced; otherwise, it is created.

Components

Universal Data Mover Manager for z/OS