Keep

PURPOSE:  The KEEP command saves the current Find Subset (FS) in a System File (SF) for future use.  Saved FS's can be restored for use by the RESTORE command.

Syntax

KEEP FS name [ENTER /IN DBL/]

FS name

specifies the table in which the FS is to be saved.  If an extension is not specified, the default extension of FS will be used.  If there is already an entry for a FS of that name in the current Data Base Library (DBL), the entry is updated, but no new entry is created.

ENTER/IN DBL

catalogs the FS in the DBL.  If an entry for a subset of this name already exists in the DBL, an error message is displayed.  If this option is omitted, the table is not cataloged in the DBL.

FS’s are generally of a temporary nature, and are used just for the duration of a specific operation.  Therefore, the overhead of listing the FS in the DBL is avoided by default, but the ENTER option does allow the FS to be entered when necessary.

EXAMPLE

A Find Subset is saved in a system file with the KEEP command, and can be restored for later use.

*USE DS BOOKS_DBM2
*EXTRACT SHOW TITLE_CODE, 1B, PRICE, 1B, TYPE_CODE
CP2264 20.00 computer
CP3896 19.99 computer
FL0839 70.00 for_lang
FL1757 109.50 for_lang
SF4567 77.00 sci_fi
SF6555 87.90 sci_fi
6 Record(s) Processed
*FIND IF TYPE_CODE = "sci_fi"
2 Record(s) Processed
F*EXTRACT SHOW TITLE_CODE,1B,PRICE
SF4567 77.00
SF6555 87.90
2 Record(s) Processed
F*KEEP FS FIRST ENTER IN DBL
F*FIND ALL
*EXTRACT SHOW TITLE_CODE,1B,PRICE,1B,TYPE_CODE
CP2264 20.00 computer
CP3896 19.99 computer
FL0839 70.00 for_lang
FL1757 109.50 for_lang
SF4567 77.00 sci_fi
SF6555 87.90 sci_fi
6 Record(s) Processed
*QUIT
$ACCENT
*USE DBL BOOKS
*DIRECTORY OF FS
Type Name
FS   FIRST DS BOOKS
*USE DS BOOKS_DBM2
*RESTORE FS FIRST
F*EXTRACT SHOW TITLE_CODE,1B,PRICE
SF4567   77.00
SF6555   87.90
2 Record(s) Processed

NOTES:  Refer to the discussion of the FIND command for information on creating and using Find Subsets (FS).

The KEEP command stores the set of pointers in the FS file that identifies the records in the FS.  It does not copy any records.

The FS object also stores the information that tells ACCENT R whether or not the Data Set (DS) has been changed.  If the original DS is modified after a FS has been saved, the FS becomes obsolete.  ACCENT R will display an error message when an attempt is made to restore it for use.  The FS must be created again before it can be used.

If the Data Base Library (DBL) has been given read-only protection at monitor level, ACCENT R is not able to record the information about DS changes in the DBL.

When an FS is copied, if the source FS has an entry in the DBL, COPY creates an entry for the new FS.  If the source will not have an entry, the new FS created by COPY does not have a DBL entry.

SEE ALSO:  RESTORE