Previous Topic: 3.8 Setting Up Your Graphic Defaults

Next Topic: 3.10 How to Enable Neugents technology in CA MICS

3.9 Data Filtering


Reports are often more meaningful if you can limit them to
just a subset of your input data.  All StorageMate reports
support the use of a common filtering panel, identified with
the title "StorageMate Data Filtering." This panel may be
accessed from each report options screen, using the ISPF UP
and DOWN keys.  This filtering panel allows you to subset, or
filter, the input data to contain only those items of
interest to you.

Use filtering with caution, as it is possible to produce
reports that would be misleading, or to specify a set of
filtering criteria that cause no data to be selected at all.
If you have problems running a certain report, first try
removing all filtering and then try again.

The filtering panel contains up to 18 filtering statements.
Each statement consists of three parts; an Element, an
Operator, and one or more testing Values.

The Element column is used to indicate the data item that is
to be tested for filtering.  Examples include the data set
name, the volume serial number, or the DFSMS storage class.

The Operator column indicates the type of comparison that
will be made.  For character elements, the following types of
operators are valid:

 EQ - Element must be equal to one of the values
 NE - ELement must not be equal to any of the values

In addition to the operators shown above, the following
operators are valid for numeric elements:

 LT - Element must be less than the value
 LE - Element must be less than or equal to the value
 GT - Element must be greater than the value
 GE - Element must be greater than or equal to the value
 RA - Element must be within the lower/upper range

The Values portion of each filtering statement should contain
zero or more values against which the element will be
compared.  Multiple values are valid for EQ and NE
comparisons.  Only one value is allowed for the other
operands, except for RA, which must have a lower and an upper
limit specified.  Unless your installation has changed the
StorageMate default, character operands may end in a trailing
asterisk (*) to indicate a prefix, generic, or "wild card"
value.  The one exception to this rule is when testing the
data set name, as that element supports values containing any
of the valid data set name mask characters.  With character
elements, a special keyword of "NULL" is supported to test
for a value of blanks or spaces.

For those StorageMate users familiar with the SAS programming
language, the Data Filtering panel will also allow free-form
SAS statements to be used in the filtering process.  Enter an
Element name of "SAS", and Operator of "EQ", and then the SAS
statement to be included.  The SAS Element is the only
element that may appear more than once on the data filtering
screen.  You can use some or all 18 lines of the screen for
SAS statements.  You may also continue SAS statements,
provided you don't mix them with other filtering statements:

Element Oper Value(s)           Element Oper Value(s)
---------------------           ---------------------
SYSID     EQ  TST* PROD         SAS       EQ  IF RECFM EQ 'U'
SAS       EQ  IF RECFM EQ 'U'   SYSID     EQ  TST* PROD
SAS       EQ  THEN DELETE;      SAS       EQ  THEN DELETE;

(CORRECT)                       (INCORRECT)

Additional examples of using SAS for filtering are shown
later in this section.

An example will now be presented of a typical completed
filtering panel:

Element Oper Value(s)
---------------------
SYSID     EQ  TST* PROD
SAS       EQ  IF SYSID EQ 'TSTZ' THEN SYSID = 'TEST';
DSNAME    NE  SYS1.**  **.LIST
STORCLAS  EQ  NULL
REFDATE   RA  01JAN91 31DEC91
ALLOCMB   GE  10

The first line selects data from the PROD System Identifier,
plus any SYSID starting with "TST".  The second line is a SAS
statement that will change any SYSID with a value of "TSTZ"
to a new value of "TEST".  The third line will drop any data
sets with the prefix SYS1 or the suffix LIST.  The fourth
line selects only those data sets with no SMS storage class
assigned.  The fifth line selects any data set referenced any
time in 1991.  The sixth line selects all data sets that
occupy 10 or more megabytes of space.  Note that each input
record read for the report shown must meet all of the
criteria shown to be selected.

More Examples of SAS Filtering
------------------------------

As explained above, the StorageMate Data Filtering panel
allows you to enter multiple lines of SAS programming
language code.  This makes the filtering and reporting
capability of CA MICS StorageMate much more powerful.  Any
statements you code on the panel are placed into the data
step for each data step used by the report.  For example, if
the report you execute uses the VCAVOA and HARDVA files, any
SAS code you specify will execute for both the specified
files.  If you want your code to apply only to some of the
files processed, a variable named "FILE" can be tested to
determine the file being processed.  This will be set to the
last three characters of the file name being processed.  For
example, you could use the following code to filter within
the VCAVOA file only:

 IF FILE EQ 'VOA' AND VOLSER EQ 'SYSRES' THEN DELETE;

While any SAS statement can be included with this facility,
remember that the code you specify will be included as part
of one or more data steps.  In most cases, this code will
perform additional filtering not possible with the filtering
options present on the panel.  Do NOT include SAS code that
will cause the current data set to be terminated, such as the
inclusion of a RUN statement or a SAS PROC statement.

Examples of valid SAS code are shown below.  Some of the
examples shown would only be valid for certain reports or
files.  The examples shown only show the Value column of the
filtering panel, and always assume an Element name of "SAS"
and an Operator of "EQ";

 Select data from all SYSIDs with an 'X' in the third
 position:  IF SUBSTR(SYSID,3,1) EQ 'X';

 Ignore data for all volume serial numbers with a JES
 prefix:  IF VOLSER EQ :'JES' THEN DELETE;

 Select only data sets with a payroll or sales prefix:
 IF DSNAME EQ :'PAY' OR DSNAME EQ :'SALES';

 Select only 3390 volumes for this analysis:
 IF DEVTYPE EQ :'3390';

 Select only data sets occupying more than 100 tracks:
 IF (FILE EQ 'DAA' OR FILE EQ '_VS') AND DAASPACA LT
 100 THEN DELETE;

If you have a complex series of SAS statements you want to
include, but that cannot fit on the filtering screen, follow
this procedure:

o Create the SAS statements you want to include and place
  them in a data set, such as your Work Data Set.

o Go to the MICF Options panel and select the option that
  allows "Additional Data Set Allocations." Use this panel to
  specify the name of the external data set containing the
  SAS statements, plus a ddname (any name you choose) that
  should be used to allocate it.  When you have completed
  this option screen, the data set you specified will always
  be allocated when MICF executes an inquiry for you, and
  will always be allocated to the ddname you specified.

o On the data filtering screen, use a SAS INCLUDE statement
  to include your SAS code.  For example, assume you placed
  some SAS code in member MYSAS of your Work Data Set.  Then
  you modified your MICF Options to always allocate your Work
  Data Set with a ddname of ADDSAS.  You would then include
  this statement on your data filtering panel when you
  generate the desired StorageMate report:

  %INCLUDE ADDSAS(MYSAS);

You could have multiple members containing SAS code defined
for different reports, and then include the correct code when
running each report.