Using all the data from an edit session to create a new member or data set

The SAVEAS primary command creates a new member of a partitioned data set (PDS or PDSE) or a new sequential, VSAM, or z/FS data set from all the lines of the data in the current editor session. If the specified member or data set exists, a warning panel is displayed and a choice is presented, allowing you to either replace the existing member (or data set) or to stop processing.

Note that the lines that are copied to the specified data set or member are only those lines which are not grouped. This means that lines in any of these groups are not copied:
  • Excluded groups.
  • Suppressed groups (groups of other record types when using a template).
  • Not-selected groups (groups of not-selected records when using a template).
This allows for a wide variety of control over what you create in the target member or data set, matching the current SHOW settings in the editor session.

If you specify the member name or data set name as part of the SAVEAS primary command, the new member or data set is created immediately from the data in the current editor session. The allocation attributes for a data set created in this way are taken from the data set in the current editor session.

When the current editor session is using a PDS, you can enter the member name with or without parentheses which is taken to mean a member within the same PDS.

You can specify a partially-qualified or fully-qualified data set name as part of the command.

Examples:
SAVEAS MEMNAM
Replaces or creates the member, MEMNAM.
SAVEAS (MEMNAM)
Replaces or creates the member, MEMNAM.
SAVEAS datasetname(MEMB1)
Replaces or creates member, MEMB1.
SAVEAS 'userid.datasetname(MEMB2)'
Replaces or creates member, MEMB2.
SAVEAS 'userid.datasetname'
Replaces or creates data set userid.datasetname, based on the current data set attributes.

If you enter the SAVEAS command without a member name or data set name, or you enter the extended version of this command, SAVEASX, File Manager displays an extended saveas panel allowing you to enter the name of a target data set and, optionally, member. This panel also allows you to decide what data set to use as a model, or, if you want, to manually enter allocation attributes for the target data set. Otherwise, the default data set attributes are taken from the data set on which the editor session is currently operating.

Examples:
SAVEAS
Displays an extended Saveas panel where you can enter the data set name and, optionally, the member name.
SAVEASX 'userid.dataset'
Displays an extended Saveas panel where you can enter the data set name and, optionally, the member name.

The Pack option on the extended Saveas panel allows you to choose whether the data being created is stored in ISPF packed or standard format. The displayed default reflects the current pack mode of the data being edited or viewed.

After the saveas processing is completed, the editor session you are returned to is an edit of the target PDS member or data set as specified, and the previous member or data set is released without any save occurring. Also note that any starting position, record limits, or sampling information that may have been previously specified, is not active for this edit of the SAVEAS target data set.

Note:
  1. In a CICS® environment, CICS® resources are not available as a target for this command. Also, MQ resources are not available as a target for this command.
  2. If the target file for a SAVEAS is a KSDS VSAM, the occurrence of duplicate keys causes an informational message to be displayed, but processing of the command continues.

Related topics