Skip to main content
Previous sectionNext section

SAVING clause

Saves DICT entry values as @ID values.

Synopsis

SAVING [UNIQUE] dict [NO.NULLS] [dict2 [NO.NULLS]] [...]

Arguments

dict An existing DICT entry or multiple DICT entries separated by blank spaces.

Description

The SAVING clause saves the specified dict value as the @ID value. If you specify multiple dict arguments it saves each one as an @ID value. The dict argument must be an existing DICT entry in the specified file.

If you specify the UNIQUE keyword, only the unique dict values are saved as the @ID values. The UNIQUE keyword applies to all the dict arguments.

If you specify the NO.NULLS keyword, only the dict values that are not null are saved as the @ID values. The NO.NULLS keyword follows a dict argument and applies to only the dict argument that immediately precedes it.

Examples

The following example saves the F2 dictionary entry values from the VOC as @ID values in select list #8:

SELECT VOC SAVING F2 TO 8
COUNT VOC FROM 8
Copy code to clipboard

The VOC in this example contains 478 items, all of which have an F2 value, so the SELECT saves 478 items to select list #8. When the LIST command inputs these items from select list #8 and matches them with the VOC @ID values, it finds matches for 327 of them (VOC @ID value = VOC F2 value), and lists the remaining 151 items as “not found”.

The following example saves the F1 and F2 dictionary entry values from the VOC as @ID values in select list #7:

SELECT VOC SAVING F1 F2 TO 7
Copy code to clipboard

It saves 956 items (478 x 2).

The following example saves the unique F2 dictionary entry values from the VOC as @ID values in select list #6:

SELECT VOC SAVING UNIQUE F2 TO 6
Copy code to clipboard

It saves 394 unique items.

The following example saves unique F1 and F2 dictionary entry values from the VOC as @ID values in select list #5:

SELECT VOC SAVING F1 F2 TO 5
Copy code to clipboard

It saves 402 items (F2 = 394 unique items + F1 = 8 unique items).

The following example saves unique and non-null F1 dictionary entry values and unique F2 dictionary entry values from the VOC as @ID values in select list #4:

SELECT VOC SAVING UNIQUE F1 F2 NO.NULLS TO 4
Copy code to clipboard

It saves 401 items (F1 = 8 unique items + F2 = 393 unique non-null items).