IMSTAT Procedure (Analytics)

MDSUMMARY Statement

The MDSUMMARY statement calculates a multi-dimensional summary for numeric variables.

Syntax

MDSUMMARY variable-list </ <set-specification,...> options>;

Optional Arguments

variable-list

specifies one or more numeric variables. If you do not specify this option, then all numeric variables in the table are used.

set-specification, ...

specifies the three elements for generating a set. Separate each set-specification with a comma.

GROUPBY=variable-name

GROUPBY=(variable-list)

specifies the list of GROUP BY variables for this set-specification. A GROUPBY= specification is required.

FORMATS=("format-specification",...)

specifies the formats for the GROUPBY= variables. If you do not specify the FORMAT= option, the default format is applied for that variable. Enclose each format specification in quotation marks and separate each format specification with a comma.

You can omit the assignment of a format for a GROUPBY= variable by entering an empty string. For example, FORMATS=("$10.", "", "BEST4.") specifies to format the first variable, with $10 and the third variable with BEST4.. The default format is applied to the second variable. The FORMATS= element of the set-specification is optional.

FILTER="expression"

specifies an optional WHERE clause for this set-specification. The filter is applied separately for each set and possibly in addition to an overall WHERE clause.

MDSUMMARY Statement Options

DESCENDING

specifies that the levels of the GROUPBY variables are to be arranged in descending order.

Alias DESC

GROUPBYLIMIT=n

specifies the maximum number of levels in a GROUPBY set. When the software determines that there are at least n levels in the GROUPBY set, it abandons the action, returns a message, and does not produce a result set. You can specify the GROUPBYLIMIT= option if you want to avoid creating excessively large result sets in GROUPBY operations.

DESCENDING

specifies that the levels of the GROUPBY variables are to be arranged in descending order.

Alias DESC

NOPREPARSE

prevents the procedure from preparsing and pregenerating code for temporary expressions, scoring programs, and other user-written SAS statements.

When this option is specified, the user-written statements are sent to the server "as is" and then the server attempts to generate code from it. If the server detects problems with the code, the error messages might not to be as detailed as the messages that are generated by SAS client. If you are debugging your user-written program, then you might want to preparse and pregenerate code in the procedure. However, if your SAS statements compile and run as you want them to, then you can specify this option to avoid the work of parsing and generating code on the SAS client.
When you specify this option in the PROC IMSTAT statement, the option applies to all statements that can generate code. You can also exclude specific statements from preparsing by using the NOPREPARSE option in statements that allow temporary columns or the SCORE statement.
Alias NOPREP

RAWORDER

specifies that the ordering of the GROUPBY variables is based on the raw values of the variables instead of the formatted values.

SAVE=table-name

saves the result table so that you can use it in other IMSTAT procedure statements like STORE, REPLAY, and FREE. The value for table-name must be unique within the scope of the procedure execution. The name of a table that has been freed with the FREE statement can be used again in subsequent SAVE= options.

SETSIZE

requests that the server estimate the size of the result set. The procedure does not create a result table if the SETSIZE option is specified. Instead, the procedure reports the number of rows that are returned by the request and the expected memory consumption for the result set (in KB). If you specify the SETSIZE option, the SAS log includes the number of observations and the estimated result set size. See the following log sample:

NOTE: The LASR Analytic Server action request for the STATEMENT
      statement would return 17 rows and approximately
      3.641 kBytes of data.
The typical use of the SETSIZE option is to get an estimate of the size of the result set in situations where you are unsure whether the SAS session can handle a large result set. Be aware that in order to determine the size of the result set, the server has to perform the work as if you were receiving the actual result set. Requesting the estimated size of the result set does consume resources on the server. The estimated number of KB is very close to the actual memory consumption of the result set. It might not be immediately obvious how this size relates to the displayed table, since many tables contain hidden columns. In addition, some elements of the result set might not be converted to tabular output by the procedure.

TEMPEXPRESS="SAS-expressions"

TEMPEXPRESS=file-reference

specifies either a quoted string that contains the SAS expression that defines the temporary variables or a file reference to an external file with the SAS statements.

Alias TE=

TEMPNAMES=variable-name

TEMPNAMES=(variable-list)

specifies the list of temporary variables for the request. Each temporary variable must be defined through SAS statements that you supply with the TEMPEXPRESS= option.

Alias TN=

TEMPTABLE

generates an in-memory temporary table from the result set. The IMSTAT procedure displays the name of the table and stores it in the &_TEMPLAST_ macro variable, provided that the statement executed successfully.

When the IMSTAT procedure exits, all temporary tables created during the IMSTAT session are removed. Temporary tables are not displayed on a TABLEINFO request, unless the temporary table is the active table for the request.

Details

ODS Table Names

The MDSUMMARY statement generates the following ODS table for each set specification.
ODS Table Name
Description
Option
Summary
Descriptive statistics
Default
TempTable
Information about a temporary table
TEMPTABLE
For information about using the ODS table with SAVE= option, see the Details section of the STORE statement.