The //SAVE-SELECTED-RECORDS statement is used to save the records that have been created by editing (//START-SELECTION or //SELECT-RECORDS) in a replacement file or analysis file.
SAVE-SELECTED-RECORDS |
TO-REDUCTION-NAME = *STD / <filename 1..38 without-cat-user-gen> ,FROM-FILE = 0 / <integer 0..9> ,ERASE-INPUT-FILES = *NO / *YES |
TO-REDUCTION-NAME =
This specifies whether a replacement file or an analysis file is to be created.
TO-REDUCTION-NAME = *STD
A replacement file with a standard file name is to be created under the default catalog ID (DEFAULT-CATID) of the SYSAUDIT user ID.
Replacement files can only be created if SATUT is running under the SYSAUDIT user ID.
TO-REDUCTION-NAME = <filename 1..38 without-cat-user-gen>
An analysis file is to be created on the current user ID.
FROM-FILE = 0 / <integer 0..9>
The work file whose contents are to be saved.
ERASE-INPUT-FILES = *NO / *YES
This defines whether input files are to be deleted.
ERASE-INPUT-FILES = *NO
The input files will not be deleted.
ERASE-INPUT-FILES = *YES
This may be specified only if a replacement file is created with TO-REDUCTION-NAME=*STD and SATUT is running under the SYSAUDIT user ID.
The input files of the SATUT session area deleted.
Exceptions:
CONSLOG files and input files that have been selected with //SELECT-INPUT-FILES ..., STATUS=NOT-CLOSED
are not deleted.
Notes
If the replacement/analysis file to be created already exists, SAT file management or SAT file evaluation has to decide in interactive mode whether or not the file is to be overwritten.
In a batch job, execution of the statement is aborted in such an event.Replacement files cannot be derived from input files with nonstandard names (analysis files), since standard input file names are required in order to compose valid replacement file names. In the event of input files with nonstandard names, an appropriate error message is returned and statement execution is aborted.
Example
SAT file management wishes to replace a number of SATLOG files by a single replacement file. This is done by first defining the input files by means of the//SELECT-INPUT-FILES statement, then specifying selection to work file 0 (//START-SELECTION) and finally issuing the following statement:
//save-selected-records from-file=0, to-reduction-name=*std, -
// erase-input-files=*yes
or in abbreviated form:
//save-sel-rec erase-input-files=*y
This statement has the effect that work file 0 is saved as the replacement file with a standard file name.