You can use a WHERE statement with the
SAS/FSP procedure statements to specify conditions
that subset the retrieved SYSTEM 2000 data. After you have invoked
one of the SAS/FSP procedures, you can use a WHERE command to subset retrieved SYSTEM 2000 data.
It is more efficient to use a WHERE clause rather than a subsetting IF statement.
The
interface view engine translates a WHERE clause into SYSTEM 2000 conditions and passes the conditions to
SYSTEM 2000 software, connecting them by default using a Boolean AND, to any SYSTEM
2000
where-clause included in the view descriptor. A where-clause in SYSTEM 2000 can reference items
contained in a view descriptor and items contained in the
access descriptor that the view descriptor is based on. Unlike a where-clause in SYSTEM 2000 that is
stored in a view descriptor, a WHERE clause in SAS is restricted to items contained
in the view descriptor.
Whether using a WHERE clause in SAS or a where-clause in SYSTEM 2000, specifying
selection criteria works essentially like filters. That
is, more data goes into the clauses than comes out. Using the SAS/ACCESS interface,
you can pass data through more than one filter. Each filter does part
of the subsetting. This is called successive filtering.
Sometimes, the interface view engine cannot translate all the WHERE clause conditions
in SAS into SYSTEM 2000 conditions.
In such cases, the
engine subsets what it can. As partially filtered records are passed back to SAS, SAS automatically
re-applies the entire WHERE clause as a second filter. This is called
post-processing. For more
information, see
WHERE Clauses in SAS and
where-clause in SYSTEM 2000.
In some SAS procedures, such as PROC FSEDIT, you can continue to apply more filters
by using the WHERE command on the command line in SAS. Each time you enter another
WHERE clause, the process
of combining and filtering conditions is repeated. The interface engine decides what
conditions it can handle, connects them by default to the prior conditions
by using the Boolean operator AND, sends them to SYSTEM 2000 for the first (sometimes
only) filtering, and then tells SAS to do any final filtering as required. For more
information, see
WHERE Clauses in SAS and
where-clause in SYSTEM 2000.
In the following example,
the subset of retrieved employee data comes from the Corporation Department,
that is, the executives. Figure 5.4 shows the
FSEDIT window after you submit the following program. Notice that the word (Subset) appears
in the window title to indicate that the data that is retrieved is a subset of the
data that is described by the view descriptor. Eleven observations that have the value
CORPORATION for DEPARTME are retrieved for
editing.
proc fsedit data=vlib.emppos;
where departme='CORPORATION';
run;
If you subset the data from within the procedure with the following command,
where departme='CORPORATION'
the
results would be identical except that the window title would show
WHERE ..., instead of (Subset), to indicate that a filter had been
applied.
Although these examples
have shown how to use a WHERE clause with PROC FSEDIT, you can also
use WHERE clauses with PROC FSBROWSE and PROC FSVIEW. For more information
about the WHERE statement in SAS, see SAS 9.3 Statements:
Reference and SAS Language Reference: Concepts . For more information about the WHERE command in SAS/FSP procedures, see
the SAS/FSP 9.3 Procedures Guide