IN

IN

Top  Previous  Next

 

The IN selection clause operator tests whether the content of a field is in a named select list.

 

 

Format

 

field IN {NO.CASE} listname

field IN {NO.CASE} "filename  id"

 

where

 

fieldis the field or evaluated expression to be compared.

 

listnameis the name of an item previously saved to the $SAVEDLISTS file that holds a field mark delimited list of acceptable values for field. The optional NO.CASE qualifier causes a case insensitive comparison to be applied. The list name should be enclosed in quotes if it may clash with a dictionary or VOC item name.

 

filenameis the name of a file containing a record that holds a field mark delimited list of acceptable values for field. The optional NO.CASE qualifier causes a case insensitive comparison to be applied. The quotes around the filename and id are mandatory.

 

idis the record id of the record in filename to be processed.

 

 

 

The IN selection clause operator causes the report output to contain only records where the content of field is in the list identified by listname or filename and id. When applied field is multivalued, at least one value must meet the condition. The EVERY qualifier can be used to test that all values are in the list.

 

 

 

Example

 

SELECT COUNTRIES SAVING SHORTCODE

SAVE.LIST CTRY

 

This sequence of commands processes the COUNTRIES file to build a select list of country codes that it then saves as CTRY. We could then go on to do

LIST CLIENTS WITH COUNTRY IN CTRY

to list only CLIENTS file records that had a valid country code.