IF Subcommand (OUTPUT MODIFY Command)
The IF
subcommand specifies particular output
objects of the types determined by SELECT
. Without
an IF
subcommand, all objects of the specified types
are selected. If you specify multiple conditions, only those objects
that meet all conditions are selected.
COMMANDS Keyword
The COMMANDS
keyword
restricts the selection to the specified commands. The keyword COMMANDS
must
be followed by an equals sign (=) and a list of quoted command identifiers
enclosed in square bracket, as in:
OUTPUT MODIFY
/SELECT TABLES
/IF COMMANDS = ['Frequencies' 'Factor Analysis']
...
The command identifier can be followed by a value
in parentheses. The value can be an integer that indicates the instance
of the command or the keyword LAST
. The keyword LAST
can
be used by itself to specify the output of the last command before OUTPUT
MODIFY
. For example:
OUTPUT MODIFY
/SELECT TABLES
/IF COMMANDS=['Frequencies(2)', 'Descriptives(LAST)', LAST]
...
In this example, the specified changes are applied to:
- The second instance of the
FREQUENCIES
command. - The last instance of the
DESCRIPTIVES
command. - The last command before the
OUTPUT MODIFY
command, if that command contains pivot table output.
Command identifiers are:
- Unique. No two commands have the same identifier.
- Not case-sensitive.
- Not subject to translation, which means they are the same for all language versions and output languages.
- Often not the same or even similar to the command name. You can obtain the identifier for a particular command by generating output from the command in the Viewer and then right-clicking the command heading in the outline pane and selecting Copy OMS Command Identifier from the menu.
Command identifiers are available for all statistical and
charting procedures and any other commands that produce blocks of
output with their own identifiable heading in the outline pane of
the Viewer. For example, CASESTOVARS
and VARSTOCASES
have
corresponding identifiers ('Cases to Variables' and 'Variables to
Cases') because they produce their own output blocks (with command
headings in the outline pane that happen to match the identifiers),
but FLIP
does not because any output produced by FLIP
is
included in a generic Log text object.
SUBTYPES Keyword
The SUBTYPES
keyword
restricts the selection to the specified table types The keyword SUBTYPES
must
be followed by an equals sign (=) and a list of quoted subtype identifiers
enclosed in square bracket, as in:
OUTPUT MODIFY
/SELECT TABLES
/IF SUBTYPES = ['Descriptive Statistics' 'Coefficients']
...
- Subtypes apply only to tables that would be displayed as pivot tables in the Viewer.
- Like command identifiers, subtype identifiers are not case-sensitive and are not subject to translation.
- Unlike command identifiers, subtype identifiers are not necessarily
unique. For example, multiple commands produce a table with the subtype
identifier "Descriptive Statistics," but not all of those tables share
the same structure. If you want only a particular table type for a
particular command, use both the
COMMANDS
andSUBTYPES
keywords. - You can obtain the identifier for a particular table by generating output from the command in the Viewer and then right-clicking outline item for the Table in the outline pane of the Viewer and selecting Copy OMS Table Subtype from the menu. The identifiers are generally fairly descriptive of the particular table type.
LABELS Keyword
The LABELS
keyword
selects particular output objects according to the text displayed
in the outline pane of the Viewer. The keyword LABELS
must
be followed by an equals sign (=) and a list of expressions enclosed
in square brackets, as in:
OUTPUT MODiFY
/SELECT TABLES
/IF LABELS = [EXACT('Age'), CONTAINS('Crosstabulation')]
...
- Each expression must start with a keyword, followed by a quoted value enclosed in parentheses.
- Valid keywords are
EXACT
,CONTAINS
,BEGINS
, andENDS
. - Label values are case-sensitive.
The LABELS
keyword is useful for differentiating
between multiple graphs or multiple tables of the same type in which
the outline text reflects some attribute of the particular output
object such as the variable names or labels. There are, however, a
number of factors that can affect the label text:
- If split file processing is on, split file group identification is often appended to the label.
- Labels that include information about variables or values are
affected by the
OVARS
andONUMBERS
settings on theSET
command. - Labels are affected by the current output language setting (
SET OLANG)
.
INSTANCES Keyword
The INSTANCES
subcommand
selects the nth instance of an object that matches the other
criteria on the IF
subcommand within a single instance
of a command. The keyword INSTANCES
must be followed
by an equals sign (=) and a list of positive integers or the keyword LAST
enclosed
in square brackets.
Example
OUTPUT MODIFY
/SELECT TABLES
/IF COMMANDS = ['Frequencies']
SUBTYPES = ['Frequencies']
INSTANCES = [1 LAST]
...
OUTPUT MODIFY
/SELECT TABLES
/IF COMMANDS = ['Frequencies']
INSTANCES = [1 LAST]
...
- The first command selects the first and last frequency tables
from each
FREQUENCIES
command. - The second command, in the absence of a
SUBTYPES
orLABELS
specification, selects the first and last tables of any kind from the selected command.
VISIBLEONLY Keyword
The VISIBLEONLY
keyword
indicates if the changes should be applied to all output objects that
meet the selection criteria or only those objects that meet the criteria
and are currently visible in the Viewer document (objects can be present
but hidden).
- VISIBLEONLY=NO
- Changes are applied to both visible and hidden objects.
- VISIBLE=YES
- Changes are applied only to visible objects.