savedata - UDM Command

Syntax

savedata [data_element_name=file_spec]

Description

The savedata command writes each line of a data element to a file on disk.

If the data element was created (via the data command) with a resolve value of all or defined, variable references within each line will be resolved, where appropriate. In such cases, if a variable reference cannot be resolved when called for, an error will be issued.

savedata issues an error if it cannot:

  • Open the specified file.
  • Write the entire contents of the data element to that file.
  • Close the file.

It also issues an error if the named data element does not exist.

Parameters

Parameter

Description

data_element_name

Name of the data element.

file_spec

Name of the file on which to write each line of the data element.

IBM i

file_spec must specify a LIB file system file; savedata does not support the HFS file system.

z/OS

When issuing savadatafile_spec can be in any of the following formats:

  • DD name in the format of dd:ddname.
  • dataset name in the format of //’data.set.name’
  • HFS file name in the format of /u/man1a/savedata.out

savedata only handles files on the file system local to the manager. You cannot use savedata to write files on other systems.

Examples

To save a data element called mydata to a DD name under z/OS called export, execute:


To save the data element to the current directory, execute:


To save the data element using an absolute path, execute: