savedata - UDM Command
savedata [data_element_name=file_spec]
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.
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 savadata, file_spec can be in any of the following formats:
savedata only handles files on the file system local to the manager. You cannot use savedata to write files on other systems. |
To save a data element called mydata to a DD name under z/OS called export, execute:
savedata mydata=dd:export
To save the data element to the current directory, execute:
savedata mydata=mydata.txt
To save the data element using an absolute path, execute:
savedata mydata="C:\documents and settings\playground\stuff.txt"