SSELECT


SSELECT generates an implicit list of record keys or specified fields, based on the selection criteria specified.

 

SYNTAX

SSELECT file-specifier {record-list} {selection-criteria} {sort-criteria} {output-criteria} {USING file-specifier} {(options}

 

SYNTAX ELEMENTS

options are:

C{n} Display running counters of the number of records selected and records processed. Unless modified by n, the counter increments after every 500 records processed or the total number of records if less than 500.

n specifies a number other than 500 by which to increment. For example, C25 increments the counter after every 25 records processed.

 

NOTES

The records will be sorted in key order unless you specify a sort criteria clause.

See also the SELECT command.

If you specify an output-criteria clause, the generated list will comprise the data (field) values defined by the clause, rather than the selected record keys.

When the command terminates, the total number of entries in the generated list is displayed and the list is made available to the next command. This is indicated by the ">" prompt if you are in jSHELL.

If you use the BY-EXP or BY-EXP-DSND connectives on a multivalued field, the list will have the format:

record-key]multivalue#

where multivalue# is the position of the multivalue within the field specified by BY-EXP or BY-EXP-DSND. multivalue# can be accessed by a READNEXT Var,n statement in a jBC program.

 

EXAMPLE 1

SSELECT SALES WITH S.CODE = "ABC]"
23 Records selected
>LIST SALES WITH VALUE > "1000"

Select all the records in SALES file with an S.CODE value that starts with ABC. Sort the list into key order. Then, using the list, report on the records in the SALES file which have a VALUE field greater than 1000.

EXAMPLE 2

SSELECT SALES WITH S.CODE = "ABC]" BY P.CODE
23 Records selected
>SAVE-LIST SALES.ABC

Select all the records in SALES file with an S.CODE value that starts with ABC. Sort the list into P.CODE order and then save the list as SALES.ABC.


jQL