Aggregation Action Set: Syntax

Provides actions for aggregating the values of one or more variables

aggregate Action

Performs aggregation on selected variables.

Aggregate Data on Selected Columns
Aggregate Data on Selected Columns by Groups
Aggregate Data on Selected Columns by Date Intervals
Perform a Rolling Window Aggregation
aggregation.aggregate <result=results> <status=rc> /
bin={double-1 <, double-2, ...>},
casOut
={
caslib="string",
compress=TRUE | FALSE,
indexVars={"variable-name-1" <, "variable-name-2", ...>},
label="string",
lifetime=64-bit-integer,
maxMemSize=64-bit-integer,
memoryFormat="DVR" | "INHERIT" | "STANDARD",
name="table-name",
onDemand=TRUE | FALSE,
promote=TRUE | FALSE,
replace=TRUE | FALSE,
replication=integer,
threadBlockSize=64-bit-integer,
timeStamp="string",
where={"string-1" <, "string-2", ...>}
},
contribute="variable-name",
contributeTrim=TRUE | FALSE,
contributeUnroll=TRUE | FALSE,
copyVars={"variable-name-1" <, "variable-name-2", ...>},
doESP=TRUE | FALSE,
edgeId="variable-name",
exclnpwgt=TRUE | FALSE,
excludeSelf=TRUE | FALSE,
freq="variable-name",
freqStrict=TRUE | FALSE,
groupByLimit=64-bit-integer,
groupedIntervalOutput=TRUE | FALSE,
id="variable-name",
idEnd=double,
idOutputName="string",
idRange={double-1 <, double-2, ...>},
idStart=double,
includeEmptyInterval=TRUE | FALSE,
includeMissing=TRUE | FALSE,
inputs
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
interval="string",
jumpingWindow=TRUE | FALSE,
keepRecord=TRUE | FALSE,
keepRecordId=TRUE | FALSE,
modeSingle=TRUE | FALSE,
offset=integer,
partKey={"string-1" <, "string-2", ...>},
pctlDef=integer,
pti=double,
ptw=double,
raw=TRUE | FALSE,
saveGroupbyFormat=TRUE | FALSE,
saveGroupbyRaw=TRUE | FALSE,
saveVariableColumn=TRUE | FALSE,
subBinOffset=double,
subBinWidth=double,
subInterval="string",
required parameter table
={
caslib="string",
computedOnDemand=TRUE | FALSE,
computedVars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
computedVarsProgram="string",
dataSourceOptions={key-1=any-list-or-data-type-1 <, key-2=any-list-or-data-type-2, ...>},
groupBy
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
groupByMode="NOSORT" | "REDISTRIBUTE",
importOptions={fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters},
required parameter name="table-name",
onDemand=TRUE | FALSE,
orderBy
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
singlePass=TRUE | FALSE,
vars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
where="where-expression",
whereTable
={
casLib="string"
dataSourceOptions={adls_noreq-parameters | bigquery-parameters | cas_noreq-parameters | clouddex-parameters | db2-parameters | dnfs-parameters | esp-parameters | fedsvr-parameters | gcs_noreq-parameters | hadoop-parameters | hana-parameters | impala-parameters | jdbc-parameters | mongodb-parameters | mysql-parameters | odbc-parameters | oracle-parameters | path-parameters | postgres-parameters | redshift-parameters | s3-parameters | sapiq-parameters | sforce-parameters | singlestore_standard-parameters | snowflake-parameters | spark-parameters | spde-parameters | sqlserver-parameters | ss_noreq-parameters | teradata-parameters | vertica-parameters | yellowbrick-parameters}
importOptions={fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters}
required parameter name="table-name"
vars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}}
where="where-expression"
}
},
varSpecs
={{
ciAlpha=double,
columnNames={"string-1" <, "string-2", ...>},
edgeId="variable-name",
exclnpwgt=TRUE | FALSE,
format="string",
formats={"string-1" <, "string-2", ...>},
freq="variable-name",
freqStrict=TRUE | FALSE,
includeMissing=TRUE | FALSE,
k=integer,
missDbl=double,
missStr="string",
modeSingle=TRUE | FALSE,
name="variable-name",
names={"variable-name-1" <, "variable-name-2", ...>},
pctlDef=integer,
percentile={double-1 <, double-2, ...>},
pN=double,
pRange={double-1 <, double-2, ...>},
pRangeMax=double,
pRangeMin=double,
pStrN="string",
pStrRange={"string-1" <, "string-2", ...>},
pStrRangeMax="string",
pStrRangeMin="string",
range={double-1 <, double-2, ...>},
rangeMax=double,
rangeMin=double,
strRange={"string-1" <, "string-2", ...>},
strRangeMax="string",
strRangeMin="string",
summarySubset={"CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR"},
weight="variable-name"
}, {...}},
weight="variable-name",
windowBin={double-1 <, double-2, ...>},
windowInt="string",
windowOffset=integer,
windowSubInt="string"
;
indicates a required parameter

Summary: Input and Output Tables

If a row includes a subparameter, you can specify the name, caslib, and so on in the subparameter. Otherwise, you can specify the name, caslib, and so on in the parameter.

Parameters for Reading Input Tables

Parameter

Subparameter

Description

required parametertable

—

specifies the table name, caslib, and other common parameters.

Parameters for Creating Output Tables

Parameter

Subparameter

Description

 casOut

—

specifies the settings for an output table.

Parameter Descriptions

align="BEGINNING" | "ENDING" | "MIDDLE"

specifies the alignment of the representative value with respect to an interval or bin.

BEGINNING

specifies to align at the beginning of an interval or bin. For example, the first day of the month is the beginning of an interval.

AliasesB
BEG
LEFT
ENDING

specifies to align at the last value of an interval or bin.

AliasesE
END
RIGHT
MIDDLE

specifies to align at the middle of an interval or bin.

AliasesM
MID

bin={double-1 <, double-2, ...>}

specifies the minimum and maximum values of a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, then the action constructs a time series with 11 bins. The first bin is [-5, 5] and the last bin is [95, 105]. The values on the upper boundary of a bin belong to this bin. The values on the lower boundary of a bin belong to the adjacent lower bin. This parameter is ignored unless you also specify an ID variable.

casOut={casouttable}

specifies the settings for an output table.

For more information about specifying the casOut parameter, see the common casouttable parameter.

contribute="variable-name"

when the doESP parameter is True, you can specify a variable whose values within each aggregation interval are recorded. The value can be used as a key to join with the original table in order to understand each row contribution toward the aggregated interval.

contributeColumnLabel="string"

specifies a value to override the variable label from the contribute variable. By default, the contribute variable's label is shown in the results.

contributeColumnName="string"

specifies a value to override the variable name from the contribute variable. By default, the contribute variable's name is shown in the results.

contributeDelimiter="string"

specifies a delimiter that is used between concatenated values of the contribute variable.

Aliasdelimiter
Default","

contributeTrim=TRUE | FALSE

when set to True, leading and trailing blanks are removed from the formatted value of the contribute variable. This parameter is ignored if the contributeUnroll parameter is set to True.

DefaultFALSE

contributeUnroll=TRUE | FALSE

by default, the formatted values from the contribute variable are concatenated together into a single row for the result table. When set to True, each raw value from the contribute variable adds a row to the result table.

Aliasunroll
DefaultFALSE

copyVars={"variable-name-1" <, "variable-name-2", ...>}

specifies the variables to copy from the input table to the output table. The raw values are kept in the output. This parameter is ignored unless you also specify the groupBy parameter for the input table. When more than one record exists in a group, the minimum raw value is copied.

AliascopyVar

doESP=TRUE | FALSE

when set to True, the action can take advantage of partitioning and ordering on the input table. You must specify the groupBy parameter for the input table. The ID variable must be specified as the last groupBy parameter and in the orderBy parameter. Setting this parameter to True implies setting the keepRecord parameter to True. When set to False (the default value), the keepRecordId, excludeSelf, contribute, contributeColumnName, contributeTrim, contributeDelimiter, and contributeUnroll parameters are ignored.

AliaspartAndOrder
DefaultFALSE

edgeId="variable-name"

specifies a numeric variable whose values are used to order the values of each varSpecs specification that uses the FIRST, LAST, FNE, or LNE aggregator. This parameter can be overridden in a varSpecs specification that includes an edgeId subparameter.

exclnpwgt=TRUE | FALSE

when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis.

AliasexcludeNonPositiveWeight
DefaultFALSE

excludeSelf=TRUE | FALSE

when set to True and the doESP parameter is True, the aggregation excludes the current observation's contribution.

DefaultFALSE

freq="variable-name"

specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used.

Aliasfrequency

freqStrict=TRUE | FALSE

this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded.

DefaultTRUE

groupByLimit=64-bit-integer

specifies the maximum number of levels in a group-by set. When the server determines this number of levels, the server stops and does not return a result. Specify this parameter if you want to avoid creating large result sets in group-by operations.

Minimum value1

groupedIntervalOutput=TRUE | FALSE

when set to True, save only one of the same aggregated intervals with respect to the last Id value. The option is ignored if 'doESP' is set to False.

DefaultFALSE

id="variable-name"

specifies a numeric variable that identifies the timestamp that is associated with each observation in the input table. The values are typically SAS DATE, TIME, or DATETIME values, but that is not required. The specified variable must also be specified in the groupBy parameter for the input table.

idEnd=double

specifies the inclusive maximum value of the ID variable to be considered in the analysis. If the maximum value of the ID variable is less than the idEnd value, the series is extended with missing values. If the last ID variable value is greater than the idEnd value, the series is truncated. This parameter is ignored unless you also specify an ID variable.

idOutputName="string"

specifies the new name of the ID variable in the output table

idRange={double-1 <, double-2, ...>}

specifies the inclusive minimum and maximum values of the ID variable to be considered in the analysis. It is equivalent to specifying both idStart and idEnd.

idStart=double

specifies the inclusive minimum value of the ID variable to be considered in the analysis. If the minimum value of the ID variable is greater than the idStart value, then the series is prefixed with missing values. If the first ID variable value is less than the idStart value, then the series is truncated. This parameter is ignored unless you also specify an ID variable.

includeEmptyInterval=TRUE | FALSE

by default, intervals with a missing value for the ID variable are included in the output. When set to False, these intervals are excluded from the output.

AliasesincludeMissInterval
includeMissingInterval
DefaultTRUE

includeMissing=TRUE | FALSE

by default, missing values are included in the analysis. When set to False, observations with missing values are excluded.

AliasesincludeMiss
incMissing
incMiss
DefaultTRUE

inputs={{casinvardesc-1} <, {casinvardesc-2}, ...>}

specifies the input variables to use in the analysis. For raw numeric variables, the default aggregator is SUMMARY. For all other situations, the default aggregator is N. You can specify variables in this parameter or exercise more control by specifying the varSpecs parameter, but you cannot use both.

For more information about specifying the inputs parameter, see the common casinvardesc parameter.

Aliasinput

interval="string"

specifies the time period for the accumulation of observations. For example, if you specify interval='MONTH', then the action summarizes the observations in monthly intervals. This parameter is ignored unless you also specify an ID variable.

jumpingWindow=TRUE | FALSE

when set to True, specifies that aggregation occurs over a time window that can contain multiple intervals and aggregation is reset when the specified time range elapses. By default, a window always retains the same multiple of intervals.

AliastumblingWindow
DefaultFALSE

keepRecord=TRUE | FALSE

when set to True, each observation's original value for the ID variable is kept without performing interval alignment.

DefaultFALSE

keepRecordId=TRUE | FALSE

when set to True and the doESP parameter is True, each observation's original ID value is kept without performing interval alignment.

DefaultFALSE

modeSingle=TRUE | FALSE

this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value.

DefaultFALSE

offset=integer

specifies the offset of each interval. If you specify offset=-1, then every interval that is derived from the data set is shifted one interval backward. For example, a timestamp value for March 1 is derived from the data set to become February 1.

AliasesintOffset
dif
intDif
intOff
Default0

partKey={"string-1" <, "string-2", ...>}

when the table is partitioned and you specify the partition parameter, you can specify a partition key so that the results are computed for the partition only.

pctlDef=integer

specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation.

Default5
Range1–5

pti=double

specifies the time value when the aggregation within an interval or a bin is terminated. For example, if you specify interval='MONTH' and partialToInterval='10FEB98'd, then the action aggregates only records from the first 10 days of each month.

Aliasesptd
partialToDate
partialToInterval
Default0
Minimum value0

ptw=double

specifies the subinterval with respect to each window interval. For example, if you specify windowInterval='MONTH' and partialToWindow='08FEB98'd, then the action counts only the first 8 days from JANUARY and the first 8 days from FEBURARY when it aggregates on window interval FEBURARY, ..., DECEMBER each year. This parameter is ignored unless you also specify the jumpingWindow parameter because the starting time varies for a sliding window (a non-jumping window).

AliaspartialToWindow
Default0
Minimum value0

raw=TRUE | FALSE

when set to True, raw values of the variables in the input parameter are used.

DefaultFALSE

saveGroupbyFormat=TRUE | FALSE

by default, the formatted values of the groupBy variables from the input table are copied to the results. When set to False, the formatted values are not copied.

AliassaveGbyFmt
DefaultTRUE

saveGroupbyRaw=TRUE | FALSE

by default, the raw values of the groupBy variables from the input table are copied to the results. When set to False, the raw values are not copied.

AliassaveGbyRaw
DefaultTRUE

saveVariableColumn=TRUE | FALSE

by default, the variable name for each analysis variable is included in the results. The result table includes the name in a column that is named 'Column.' When set to False, this column is not included in the results.

AliassaveVarCol
DefaultTRUE

saveVariableSpecification=TRUE | FALSE

by default, the results include a column that is named 'Variable Specification' to identify the varSpecs specification that produced the result. When set to False, this column is not included in the results.

AliassaveVarSpec
DefaultTRUE

subBinOffset=double

specifies an offset from the beginning of a bin. The value must be positive and less than or equal to the bin width. If the specified value is out of range, this parameter is ignored. This parameter is ignored unless you specify an ID variable and the bin parameter.

subBinWidth=double

specifies the width of the sub bin within a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, subBinOffset=2, and subBinWidth=5, then the action summarizes only the observations with ID variable values that fall into [-2, 3], [8, 13], [18, 23], ..., [98, 103]. The specified value must be positive and the sum of the subBinOffset value and subBinWidth value must be less than or equal to the bin width. If the value is out of range, this parameter is ignored. This parameter is ignored unless you also specify an ID variable and the bin parameter.

Minimum value0

subInterval="string"

specifies a smaller interval to control the time period alignment within each interval for the aggregation of observations.

AliassubInt

* table={castable}

specifies the table name, caslib, and other common parameters.

For more information about specifying the table parameter, see the common castable parameter.

varSpecs={{tkcasagg_varspecs-1} <, {tkcasagg_varspecs-2}, ...>}

specifies the variable to aggregate and the settings for the aggregator.

The tkcasagg_varspecs value can be one or more of the following:

agg="FIRST" | "FIRSTNOTEMPTY" | "LAST" | "LASTNOTEMPTY" | "MAXIMUM" | "MINIMUM" | "MODE" | "N" | "NDISTINCT" | "NMISS" | "NTOTAL" | "PERCENT" | "PERCENTILE" | "PGT" | "PLT" | "Q1" | "Q2" | "Q3" | "SUMMARY"

specifies the aggregator to apply to the analysis variable.

FIRST

returns the minimum value of the edgeId variable.

FIRSTNOTEMPTY

returns the minimum non-empty value of the edgeId variable.

AliasFNE
LAST

returns the maximum value of the edgeId variable.

LASTNOTEMPTY

returns the maximum non-empty value of the edgeId variable.

AliasLNE
MAXIMUM

returns the maximum nonmissing value.

AliasMAX
MINIMUM

returns the minimum nonmissing value.

AliasMIN
MODE

returns the most frequent value. You can specify the k parameter to return more than the most frequent values.

N

returns the number of observations, excluding missing values.

NDISTINCT

returns the number of distinct values. This is the default aggregator for character variables and numeric variables that have a format.

AliasNDIST
NMISS

returns the number of missing values.

NTOTAL

returns the number of observations, including missing values.

AliasNTTL
PERCENT

returns the percentage of values in the range that is specified in the pRange or pStrRange parameter.

AliasesPIN
PCIN
PERCENTILE

returns the statistics that are specified in the percentiles parameter.

PGT

returns the percentage of values that are greater than the threshold specified in the pN or pStrN parameter.

AliasPCGT
PLT

returns the percentage of values that are less than the threshold specified in the pN or pStrL parameter.

AliasPCLT
Q1

returns the value that is closest to the 25th percentile.

Q2

returns the value that is closest to the 50th percentile.

AliasesMED
MEDIAN
Q3

returns the value that is closest to the 75th percentile.

SUMMARY

returns the summary statistics for numeric variables including MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS. This is the default aggregator for raw numeric variables.

ciAlpha=double

specifies the level of significance for 100*(1-ciAlpha)% confidence intervals. The default value of 0.05 results in 95% confidence intervals.

Default0.05
Range(0, 1)
ciType="LOWER" | "TWOSIDED" | "UPPER"

specifies the type of confidence interval.

DefaultTWOSIDED
LOWER

specifies to use the lower bound of where the true population mean is expected to lie, given the specified confidence.

AliasLEFT
TWOSIDED

specifies to use the two-sided confidence interval within which the true population mean is expected to lie, given the specified confidence.

UPPER

specifies to use the upper bound of where the true population mean is expected to lie, given the specified confidence.

AliasRIGHT
columnNames={"string-1" <, "string-2", ...>}

specifies replacement column names to use in the results. By default, the name of the analysis variable is used as a column name in the result tables.

AliasescolName
colNames
RequirementThe specified values must be unique.
edgeId="variable-name"

specifies a numeric variable whose values are used to order the values of the analysis variable. This parameter applies to the FIRST, LAST, FNE, or LNE aggregators. Specifying this parameter in a varSpec parameter overrides the setting for the action.

exclnpwgt=TRUE | FALSE

when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis. Specifying this parameter in a varSpec parameter overrides the setting for the action.

AliasexcludeNonPositiveWeight
DefaultFALSE
format="string"

specifies a temporary format for the analysis variable.

formats={"string-1" <, "string-2", ...>}

specifies a temporary format for the analysis variable.

freq="variable-name"

specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used. Specifying this parameter in a varSpec parameter overrides the setting for the action.

Aliasfrequency
freqStrict=TRUE | FALSE

this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.

DefaultTRUE
includeMissing=TRUE | FALSE

by default, missing values are included in the analysis. When set to False, observations with missing values are excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.

AliasesincludeMiss
incMissing
incMiss
DefaultTRUE
k=integer

specifies the number of the most frequent items to collect for the MODE aggregator.

Default1
Range1–MACINT
missDbl=double

specifies the numeric value to use for replacing the missing values.

missStr="string"

specifies the character value to use for replacing the missing values.

modeSingle=TRUE | FALSE

this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value. Specifying this parameter in a varSpec parameter overrides the setting for the action.

DefaultFALSE
name="variable-name"

specifies the analysis variable name.

Aliasvar
names={"variable-name-1" <, "variable-name-2", ...>}

specifies the analysis variable name.

Aliasvars
pctlDef=integer

specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation. Specifying this parameter in a varSpec parameter overrides the setting for the action.

Range1–5
percentile={double-1 <, double-2, ...>}

specifies the percentile to calculate when the aggregator is set to PERCENTILE.

Aliasespercentiles
pctl
pctls
RequirementThe specified values must be unique.
pN=double

specifies the numeric threshold for the PGT and PLT aggregators on a numeric variable.

pRange={double-1 <, double-2, ...>}

specifies the inclusive minimum and maximum values for the PIN aggregator on a numeric variable. It is equivalent to specifying both the pRangeMin and pRangeMax parameters.

pRangeMax=double

specifies the inclusive maximum value for the PIN aggregator on a numeric variable.

DefaultMACBIG
pRangeMin=double

specifies the inclusive minimum value for the PIN aggregator on a numeric variable.

Default-MACBIG
pStrN="string"

specifies the character threshold for the PGT and PLT aggregators on a character variable.

pStrRange={"string-1" <, "string-2", ...>}

specifies the inclusive minimum and maximum values for the PIN aggregator on a character variable. It is equivalent to specifying both the pStrRangeMin and pStrRangeMax parameters.

pStrRangeMax="string"

specifies the inclusive maximum value for the PIN aggregator on a character variable.

pStrRangeMin="string"

specifies the inclusive minimum value for the PIN aggregator on a character variable.

range={double-1 <, double-2, ...>}

specifies the inclusive minimum and maximum values of a numeric variable to be considered in the aggregation. It is equivalent to specifying both the rangeMin and rangeMax parameters.

rangeMax=double

specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.

DefaultMACBIG
rangeMin=double

specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.

Default-MACBIG
strRange={"string-1" <, "string-2", ...>}

specifies the inclusive minimum and maximum values of a character variable to be considered in the aggregation. It is equivalent to specifying both the strRangeMin and strRangeMax parameters.

strRangeMax="string"

specifies the inclusive maximum value of a character variable to be considered in the aggregation.

strRangeMin="string"

specifies the inclusive minimum value of a character variable to be considered in the aggregation.

summarySubset={"CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR"}

specifies the summary statistics to generate. By default, the column order of the summary statistics is MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS, regardless of the order that you specify. If you want the columns returned in a particular order, be sure to provide a name for each results column using the columnNames parameter.

Aliasesstatistics
subSet
RequirementThe specified values must be unique.
weight="variable-name"

specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior. Specifying this parameter in a varSpec parameter overrides the setting for the action.

weight="variable-name"

specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior.

windowBin={double-1 <, double-2, ...>}

specifies the minimum and maximum values of a window bin. The specification and concepts are similar to the bin parameter, except the bins apply to intervals.

windowInt="string"

specifies the time window for the accumulation of observations with respect to each time interval. For example, if you specify interval='MONTH' and windowInt='YEAR', then the action summarizes one year's worth of observations in monthly intervals.

AliaseswinInt
windowInterval

windowOffset=integer

specifies the offset of each window interval. The effect is similar to how the offset parameter impacts the values for the interval parameter.

AliaseswindowIntOffset
winDif
winIntDif
winIntOff
windowIntervalOffset
Default0

windowSubBinOffset=double

specifies the starting point within a window bin in which record values are aggregated. For example, if you specify windowBin={0, 10} and windowSubBinOffset=2, then records with ID variable values in the interval [0, 2) are ignored. The specified value must not be larger than the window bin's width.

AliaswinSubBinOffset

windowSubBinWidth=double

specifies the width of the sub bin within each windowBin. The minimum acceptable value is 0, which renders windows ineffective. For example, if you specify windowBin={0, 10}, windowSubBinOffset=2, and windowSubBinWidth=5, then records with ID variable values in the intervals [0, 2) and [7, 10) are ignored.

AliaswinSubBinWidth
Minimum value0

windowSubInt="string"

this parameter is similar to subInterval. You can specify a smaller interval to control the sub time period alignment within each window interval for the aggregation of observations.

AliaseswinSubInterval
winSubInt
windowSubInterval

aggregate Action

Performs aggregation on selected variables.

Aggregate Data on Selected Columns
Aggregate Data on Selected Columns by Groups
Aggregate Data on Selected Columns by Date Intervals
Perform a Rolling Window Aggregation
results, info = s:aggregation_aggregate{
bin={double-1 <, double-2, ...>},
casOut
={
caslib="string",
compress=true | false,
indexVars={"variable-name-1" <, "variable-name-2", ...>},
label="string",
lifetime=64-bit-integer,
maxMemSize=64-bit-integer,
memoryFormat="DVR" | "INHERIT" | "STANDARD",
name="table-name",
onDemand=true | false,
promote=true | false,
replace=true | false,
replication=integer,
threadBlockSize=64-bit-integer,
timeStamp="string",
where={"string-1" <, "string-2", ...>}
},
contribute="variable-name",
contributeTrim=true | false,
contributeUnroll=true | false,
copyVars={"variable-name-1" <, "variable-name-2", ...>},
doESP=true | false,
edgeId="variable-name",
exclnpwgt=true | false,
excludeSelf=true | false,
freq="variable-name",
freqStrict=true | false,
groupByLimit=64-bit-integer,
groupedIntervalOutput=true | false,
id="variable-name",
idEnd=double,
idOutputName="string",
idRange={double-1 <, double-2, ...>},
idStart=double,
includeEmptyInterval=true | false,
includeMissing=true | false,
inputs
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
interval="string",
jumpingWindow=true | false,
keepRecord=true | false,
keepRecordId=true | false,
modeSingle=true | false,
offset=integer,
partKey={"string-1" <, "string-2", ...>},
pctlDef=integer,
pti=double,
ptw=double,
raw=true | false,
saveGroupbyFormat=true | false,
saveGroupbyRaw=true | false,
saveVariableColumn=true | false,
subBinOffset=double,
subBinWidth=double,
subInterval="string",
required parameter table
={
caslib="string",
computedOnDemand=true | false,
computedVars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
computedVarsProgram="string",
dataSourceOptions={key-1=any-list-or-data-type-1 <, key-2=any-list-or-data-type-2, ...>},
groupBy
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
groupByMode="NOSORT" | "REDISTRIBUTE",
importOptions={fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters},
required parameter name="table-name",
onDemand=true | false,
orderBy
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
singlePass=true | false,
vars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
where="where-expression",
whereTable
={
casLib="string"
dataSourceOptions={adls_noreq-parameters | bigquery-parameters | cas_noreq-parameters | clouddex-parameters | db2-parameters | dnfs-parameters | esp-parameters | fedsvr-parameters | gcs_noreq-parameters | hadoop-parameters | hana-parameters | impala-parameters | jdbc-parameters | mongodb-parameters | mysql-parameters | odbc-parameters | oracle-parameters | path-parameters | postgres-parameters | redshift-parameters | s3-parameters | sapiq-parameters | sforce-parameters | singlestore_standard-parameters | snowflake-parameters | spark-parameters | spde-parameters | sqlserver-parameters | ss_noreq-parameters | teradata-parameters | vertica-parameters | yellowbrick-parameters}
importOptions={fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters}
required parameter name="table-name"
vars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}}
where="where-expression"
}
},
varSpecs
={{
ciAlpha=double,
columnNames={"string-1" <, "string-2", ...>},
edgeId="variable-name",
exclnpwgt=true | false,
format="string",
formats={"string-1" <, "string-2", ...>},
freq="variable-name",
freqStrict=true | false,
includeMissing=true | false,
k=integer,
missDbl=double,
missStr="string",
modeSingle=true | false,
name="variable-name",
names={"variable-name-1" <, "variable-name-2", ...>},
pctlDef=integer,
percentile={double-1 <, double-2, ...>},
pN=double,
pRange={double-1 <, double-2, ...>},
pRangeMax=double,
pRangeMin=double,
pStrN="string",
pStrRange={"string-1" <, "string-2", ...>},
pStrRangeMax="string",
pStrRangeMin="string",
range={double-1 <, double-2, ...>},
rangeMax=double,
rangeMin=double,
strRange={"string-1" <, "string-2", ...>},
strRangeMax="string",
strRangeMin="string",
summarySubset={"CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR"},
weight="variable-name"
}, {...}},
weight="variable-name",
windowBin={double-1 <, double-2, ...>},
windowInt="string",
windowOffset=integer,
windowSubInt="string"
}
indicates a required parameter

Summary: Input and Output Tables

If a row includes a subparameter, you can specify the name, caslib, and so on in the subparameter. Otherwise, you can specify the name, caslib, and so on in the parameter.

Parameters for Reading Input Tables

Parameter

Subparameter

Description

required parametertable

—

specifies the table name, caslib, and other common parameters.

Parameters for Creating Output Tables

Parameter

Subparameter

Description

 casOut

—

specifies the settings for an output table.

Parameter Descriptions

align="BEGINNING" | "ENDING" | "MIDDLE"

specifies the alignment of the representative value with respect to an interval or bin.

BEGINNING

specifies to align at the beginning of an interval or bin. For example, the first day of the month is the beginning of an interval.

AliasesB
BEG
LEFT
ENDING

specifies to align at the last value of an interval or bin.

AliasesE
END
RIGHT
MIDDLE

specifies to align at the middle of an interval or bin.

AliasesM
MID

bin={double-1 <, double-2, ...>}

specifies the minimum and maximum values of a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, then the action constructs a time series with 11 bins. The first bin is [-5, 5] and the last bin is [95, 105]. The values on the upper boundary of a bin belong to this bin. The values on the lower boundary of a bin belong to the adjacent lower bin. This parameter is ignored unless you also specify an ID variable.

casOut={casouttable}

specifies the settings for an output table.

For more information about specifying the casOut parameter, see the common casouttable parameter.

contribute="variable-name"

when the doESP parameter is True, you can specify a variable whose values within each aggregation interval are recorded. The value can be used as a key to join with the original table in order to understand each row contribution toward the aggregated interval.

contributeColumnLabel="string"

specifies a value to override the variable label from the contribute variable. By default, the contribute variable's label is shown in the results.

contributeColumnName="string"

specifies a value to override the variable name from the contribute variable. By default, the contribute variable's name is shown in the results.

contributeDelimiter="string"

specifies a delimiter that is used between concatenated values of the contribute variable.

Aliasdelimiter
Default","

contributeTrim=true | false

when set to True, leading and trailing blanks are removed from the formatted value of the contribute variable. This parameter is ignored if the contributeUnroll parameter is set to True.

Defaultfalse

contributeUnroll=true | false

by default, the formatted values from the contribute variable are concatenated together into a single row for the result table. When set to True, each raw value from the contribute variable adds a row to the result table.

Aliasunroll
Defaultfalse

copyVars={"variable-name-1" <, "variable-name-2", ...>}

specifies the variables to copy from the input table to the output table. The raw values are kept in the output. This parameter is ignored unless you also specify the groupBy parameter for the input table. When more than one record exists in a group, the minimum raw value is copied.

AliascopyVar

doESP=true | false

when set to True, the action can take advantage of partitioning and ordering on the input table. You must specify the groupBy parameter for the input table. The ID variable must be specified as the last groupBy parameter and in the orderBy parameter. Setting this parameter to True implies setting the keepRecord parameter to True. When set to False (the default value), the keepRecordId, excludeSelf, contribute, contributeColumnName, contributeTrim, contributeDelimiter, and contributeUnroll parameters are ignored.

AliaspartAndOrder
Defaultfalse

edgeId="variable-name"

specifies a numeric variable whose values are used to order the values of each varSpecs specification that uses the FIRST, LAST, FNE, or LNE aggregator. This parameter can be overridden in a varSpecs specification that includes an edgeId subparameter.

exclnpwgt=true | false

when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis.

AliasexcludeNonPositiveWeight
Defaultfalse

excludeSelf=true | false

when set to True and the doESP parameter is True, the aggregation excludes the current observation's contribution.

Defaultfalse

freq="variable-name"

specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used.

Aliasfrequency

freqStrict=true | false

this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded.

Defaulttrue

groupByLimit=64-bit-integer

specifies the maximum number of levels in a group-by set. When the server determines this number of levels, the server stops and does not return a result. Specify this parameter if you want to avoid creating large result sets in group-by operations.

Minimum value1

groupedIntervalOutput=true | false

when set to True, save only one of the same aggregated intervals with respect to the last Id value. The option is ignored if 'doESP' is set to False.

Defaultfalse

id="variable-name"

specifies a numeric variable that identifies the timestamp that is associated with each observation in the input table. The values are typically SAS DATE, TIME, or DATETIME values, but that is not required. The specified variable must also be specified in the groupBy parameter for the input table.

idEnd=double

specifies the inclusive maximum value of the ID variable to be considered in the analysis. If the maximum value of the ID variable is less than the idEnd value, the series is extended with missing values. If the last ID variable value is greater than the idEnd value, the series is truncated. This parameter is ignored unless you also specify an ID variable.

idOutputName="string"

specifies the new name of the ID variable in the output table

idRange={double-1 <, double-2, ...>}

specifies the inclusive minimum and maximum values of the ID variable to be considered in the analysis. It is equivalent to specifying both idStart and idEnd.

idStart=double

specifies the inclusive minimum value of the ID variable to be considered in the analysis. If the minimum value of the ID variable is greater than the idStart value, then the series is prefixed with missing values. If the first ID variable value is less than the idStart value, then the series is truncated. This parameter is ignored unless you also specify an ID variable.

includeEmptyInterval=true | false

by default, intervals with a missing value for the ID variable are included in the output. When set to False, these intervals are excluded from the output.

AliasesincludeMissInterval
includeMissingInterval
Defaulttrue

includeMissing=true | false

by default, missing values are included in the analysis. When set to False, observations with missing values are excluded.

AliasesincludeMiss
incMissing
incMiss
Defaulttrue

inputs={{casinvardesc-1} <, {casinvardesc-2}, ...>}

specifies the input variables to use in the analysis. For raw numeric variables, the default aggregator is SUMMARY. For all other situations, the default aggregator is N. You can specify variables in this parameter or exercise more control by specifying the varSpecs parameter, but you cannot use both.

For more information about specifying the inputs parameter, see the common casinvardesc parameter.

Aliasinput

interval="string"

specifies the time period for the accumulation of observations. For example, if you specify interval='MONTH', then the action summarizes the observations in monthly intervals. This parameter is ignored unless you also specify an ID variable.

jumpingWindow=true | false

when set to True, specifies that aggregation occurs over a time window that can contain multiple intervals and aggregation is reset when the specified time range elapses. By default, a window always retains the same multiple of intervals.

AliastumblingWindow
Defaultfalse

keepRecord=true | false

when set to True, each observation's original value for the ID variable is kept without performing interval alignment.

Defaultfalse

keepRecordId=true | false

when set to True and the doESP parameter is True, each observation's original ID value is kept without performing interval alignment.

Defaultfalse

modeSingle=true | false

this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value.

Defaultfalse

offset=integer

specifies the offset of each interval. If you specify offset=-1, then every interval that is derived from the data set is shifted one interval backward. For example, a timestamp value for March 1 is derived from the data set to become February 1.

AliasesintOffset
dif
intDif
intOff
Default0

partKey={"string-1" <, "string-2", ...>}

when the table is partitioned and you specify the partition parameter, you can specify a partition key so that the results are computed for the partition only.

pctlDef=integer

specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation.

Default5
Range1–5

pti=double

specifies the time value when the aggregation within an interval or a bin is terminated. For example, if you specify interval='MONTH' and partialToInterval='10FEB98'd, then the action aggregates only records from the first 10 days of each month.

Aliasesptd
partialToDate
partialToInterval
Default0
Minimum value0

ptw=double

specifies the subinterval with respect to each window interval. For example, if you specify windowInterval='MONTH' and partialToWindow='08FEB98'd, then the action counts only the first 8 days from JANUARY and the first 8 days from FEBURARY when it aggregates on window interval FEBURARY, ..., DECEMBER each year. This parameter is ignored unless you also specify the jumpingWindow parameter because the starting time varies for a sliding window (a non-jumping window).

AliaspartialToWindow
Default0
Minimum value0

raw=true | false

when set to True, raw values of the variables in the input parameter are used.

Defaultfalse

saveGroupbyFormat=true | false

by default, the formatted values of the groupBy variables from the input table are copied to the results. When set to False, the formatted values are not copied.

AliassaveGbyFmt
Defaulttrue

saveGroupbyRaw=true | false

by default, the raw values of the groupBy variables from the input table are copied to the results. When set to False, the raw values are not copied.

AliassaveGbyRaw
Defaulttrue

saveVariableColumn=true | false

by default, the variable name for each analysis variable is included in the results. The result table includes the name in a column that is named 'Column.' When set to False, this column is not included in the results.

AliassaveVarCol
Defaulttrue

saveVariableSpecification=true | false

by default, the results include a column that is named 'Variable Specification' to identify the varSpecs specification that produced the result. When set to False, this column is not included in the results.

AliassaveVarSpec
Defaulttrue

subBinOffset=double

specifies an offset from the beginning of a bin. The value must be positive and less than or equal to the bin width. If the specified value is out of range, this parameter is ignored. This parameter is ignored unless you specify an ID variable and the bin parameter.

subBinWidth=double

specifies the width of the sub bin within a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, subBinOffset=2, and subBinWidth=5, then the action summarizes only the observations with ID variable values that fall into [-2, 3], [8, 13], [18, 23], ..., [98, 103]. The specified value must be positive and the sum of the subBinOffset value and subBinWidth value must be less than or equal to the bin width. If the value is out of range, this parameter is ignored. This parameter is ignored unless you also specify an ID variable and the bin parameter.

Minimum value0

subInterval="string"

specifies a smaller interval to control the time period alignment within each interval for the aggregation of observations.

AliassubInt

* table={castable}

specifies the table name, caslib, and other common parameters.

For more information about specifying the table parameter, see the common castable parameter.

varSpecs={{tkcasagg_varspecs-1} <, {tkcasagg_varspecs-2}, ...>}

specifies the variable to aggregate and the settings for the aggregator.

The tkcasagg_varspecs value can be one or more of the following:

agg="FIRST" | "FIRSTNOTEMPTY" | "LAST" | "LASTNOTEMPTY" | "MAXIMUM" | "MINIMUM" | "MODE" | "N" | "NDISTINCT" | "NMISS" | "NTOTAL" | "PERCENT" | "PERCENTILE" | "PGT" | "PLT" | "Q1" | "Q2" | "Q3" | "SUMMARY"

specifies the aggregator to apply to the analysis variable.

FIRST

returns the minimum value of the edgeId variable.

FIRSTNOTEMPTY

returns the minimum non-empty value of the edgeId variable.

AliasFNE
LAST

returns the maximum value of the edgeId variable.

LASTNOTEMPTY

returns the maximum non-empty value of the edgeId variable.

AliasLNE
MAXIMUM

returns the maximum nonmissing value.

AliasMAX
MINIMUM

returns the minimum nonmissing value.

AliasMIN
MODE

returns the most frequent value. You can specify the k parameter to return more than the most frequent values.

N

returns the number of observations, excluding missing values.

NDISTINCT

returns the number of distinct values. This is the default aggregator for character variables and numeric variables that have a format.

AliasNDIST
NMISS

returns the number of missing values.

NTOTAL

returns the number of observations, including missing values.

AliasNTTL
PERCENT

returns the percentage of values in the range that is specified in the pRange or pStrRange parameter.

AliasesPIN
PCIN
PERCENTILE

returns the statistics that are specified in the percentiles parameter.

PGT

returns the percentage of values that are greater than the threshold specified in the pN or pStrN parameter.

AliasPCGT
PLT

returns the percentage of values that are less than the threshold specified in the pN or pStrL parameter.

AliasPCLT
Q1

returns the value that is closest to the 25th percentile.

Q2

returns the value that is closest to the 50th percentile.

AliasesMED
MEDIAN
Q3

returns the value that is closest to the 75th percentile.

SUMMARY

returns the summary statistics for numeric variables including MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS. This is the default aggregator for raw numeric variables.

ciAlpha=double

specifies the level of significance for 100*(1-ciAlpha)% confidence intervals. The default value of 0.05 results in 95% confidence intervals.

Default0.05
Range(0, 1)
ciType="LOWER" | "TWOSIDED" | "UPPER"

specifies the type of confidence interval.

DefaultTWOSIDED
LOWER

specifies to use the lower bound of where the true population mean is expected to lie, given the specified confidence.

AliasLEFT
TWOSIDED

specifies to use the two-sided confidence interval within which the true population mean is expected to lie, given the specified confidence.

UPPER

specifies to use the upper bound of where the true population mean is expected to lie, given the specified confidence.

AliasRIGHT
columnNames={"string-1" <, "string-2", ...>}

specifies replacement column names to use in the results. By default, the name of the analysis variable is used as a column name in the result tables.

AliasescolName
colNames
RequirementThe specified values must be unique.
edgeId="variable-name"

specifies a numeric variable whose values are used to order the values of the analysis variable. This parameter applies to the FIRST, LAST, FNE, or LNE aggregators. Specifying this parameter in a varSpec parameter overrides the setting for the action.

exclnpwgt=true | false

when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis. Specifying this parameter in a varSpec parameter overrides the setting for the action.

AliasexcludeNonPositiveWeight
Defaultfalse
format="string"

specifies a temporary format for the analysis variable.

formats={"string-1" <, "string-2", ...>}

specifies a temporary format for the analysis variable.

freq="variable-name"

specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used. Specifying this parameter in a varSpec parameter overrides the setting for the action.

Aliasfrequency
freqStrict=true | false

this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.

Defaulttrue
includeMissing=true | false

by default, missing values are included in the analysis. When set to False, observations with missing values are excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.

AliasesincludeMiss
incMissing
incMiss
Defaulttrue
k=integer

specifies the number of the most frequent items to collect for the MODE aggregator.

Default1
Range1–MACINT
missDbl=double

specifies the numeric value to use for replacing the missing values.

missStr="string"

specifies the character value to use for replacing the missing values.

modeSingle=true | false

this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value. Specifying this parameter in a varSpec parameter overrides the setting for the action.

Defaultfalse
name="variable-name"

specifies the analysis variable name.

Aliasvar
names={"variable-name-1" <, "variable-name-2", ...>}

specifies the analysis variable name.

Aliasvars
pctlDef=integer

specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation. Specifying this parameter in a varSpec parameter overrides the setting for the action.

Range1–5
percentile={double-1 <, double-2, ...>}

specifies the percentile to calculate when the aggregator is set to PERCENTILE.

Aliasespercentiles
pctl
pctls
RequirementThe specified values must be unique.
pN=double

specifies the numeric threshold for the PGT and PLT aggregators on a numeric variable.

pRange={double-1 <, double-2, ...>}

specifies the inclusive minimum and maximum values for the PIN aggregator on a numeric variable. It is equivalent to specifying both the pRangeMin and pRangeMax parameters.

pRangeMax=double

specifies the inclusive maximum value for the PIN aggregator on a numeric variable.

DefaultMACBIG
pRangeMin=double

specifies the inclusive minimum value for the PIN aggregator on a numeric variable.

Default-MACBIG
pStrN="string"

specifies the character threshold for the PGT and PLT aggregators on a character variable.

pStrRange={"string-1" <, "string-2", ...>}

specifies the inclusive minimum and maximum values for the PIN aggregator on a character variable. It is equivalent to specifying both the pStrRangeMin and pStrRangeMax parameters.

pStrRangeMax="string"

specifies the inclusive maximum value for the PIN aggregator on a character variable.

pStrRangeMin="string"

specifies the inclusive minimum value for the PIN aggregator on a character variable.

range={double-1 <, double-2, ...>}

specifies the inclusive minimum and maximum values of a numeric variable to be considered in the aggregation. It is equivalent to specifying both the rangeMin and rangeMax parameters.

rangeMax=double

specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.

DefaultMACBIG
rangeMin=double

specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.

Default-MACBIG
strRange={"string-1" <, "string-2", ...>}

specifies the inclusive minimum and maximum values of a character variable to be considered in the aggregation. It is equivalent to specifying both the strRangeMin and strRangeMax parameters.

strRangeMax="string"

specifies the inclusive maximum value of a character variable to be considered in the aggregation.

strRangeMin="string"

specifies the inclusive minimum value of a character variable to be considered in the aggregation.

summarySubset={"CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR"}

specifies the summary statistics to generate. By default, the column order of the summary statistics is MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS, regardless of the order that you specify. If you want the columns returned in a particular order, be sure to provide a name for each results column using the columnNames parameter.

Aliasesstatistics
subSet
RequirementThe specified values must be unique.
weight="variable-name"

specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior. Specifying this parameter in a varSpec parameter overrides the setting for the action.

weight="variable-name"

specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior.

windowBin={double-1 <, double-2, ...>}

specifies the minimum and maximum values of a window bin. The specification and concepts are similar to the bin parameter, except the bins apply to intervals.

windowInt="string"

specifies the time window for the accumulation of observations with respect to each time interval. For example, if you specify interval='MONTH' and windowInt='YEAR', then the action summarizes one year's worth of observations in monthly intervals.

AliaseswinInt
windowInterval

windowOffset=integer

specifies the offset of each window interval. The effect is similar to how the offset parameter impacts the values for the interval parameter.

AliaseswindowIntOffset
winDif
winIntDif
winIntOff
windowIntervalOffset
Default0

windowSubBinOffset=double

specifies the starting point within a window bin in which record values are aggregated. For example, if you specify windowBin={0, 10} and windowSubBinOffset=2, then records with ID variable values in the interval [0, 2) are ignored. The specified value must not be larger than the window bin's width.

AliaswinSubBinOffset

windowSubBinWidth=double

specifies the width of the sub bin within each windowBin. The minimum acceptable value is 0, which renders windows ineffective. For example, if you specify windowBin={0, 10}, windowSubBinOffset=2, and windowSubBinWidth=5, then records with ID variable values in the intervals [0, 2) and [7, 10) are ignored.

AliaswinSubBinWidth
Minimum value0

windowSubInt="string"

this parameter is similar to subInterval. You can specify a smaller interval to control the sub time period alignment within each window interval for the aggregation of observations.

AliaseswinSubInterval
winSubInt
windowSubInterval

aggregate Action

Performs aggregation on selected variables.

Aggregate Data on Selected Columns
Aggregate Data on Selected Columns by Groups
Aggregate Data on Selected Columns by Date Intervals
Perform a Rolling Window Aggregation
results=s.aggregation.aggregate(
bin=[double-1 <, double-2, ...>],
casOut
={
"caslib":"string",
"compress":True | False,
"indexVars":["variable-name-1" <, "variable-name-2", ...>],
"label":"string",
"lifetime":64-bit-integer,
"maxMemSize":64-bit-integer,
"memoryFormat":"DVR" | "INHERIT" | "STANDARD",
"name":"table-name",
"onDemand":True | False,
"promote":True | False,
"replace":True | False,
"replication":integer,
"threadBlockSize":64-bit-integer,
"timeStamp":"string",
"where":["string-1" <, "string-2", ...>]
},
contribute="variable-name",
contributeTrim=True | False,
contributeUnroll=True | False,
copyVars=["variable-name-1" <, "variable-name-2", ...>],
doESP=True | False,
edgeId="variable-name",
exclnpwgt=True | False,
excludeSelf=True | False,
freq="variable-name",
freqStrict=True | False,
groupByLimit=64-bit-integer,
groupedIntervalOutput=True | False,
id="variable-name",
idEnd=double,
idOutputName="string",
idRange=[double-1 <, double-2, ...>],
idStart=double,
includeEmptyInterval=True | False,
includeMissing=True | False,
inputs
=[{
"format":"string",
"formattedLength":integer,
"label":"string",
required parameter "name":"variable-name",
"nfd":integer,
"nfl":integer
}<, {...}>],
interval="string",
jumpingWindow=True | False,
keepRecord=True | False,
keepRecordId=True | False,
modeSingle=True | False,
offset=integer,
partKey=["string-1" <, "string-2", ...>],
pctlDef=integer,
pti=double,
ptw=double,
raw=True | False,
saveGroupbyFormat=True | False,
saveGroupbyRaw=True | False,
saveVariableColumn=True | False,
subBinOffset=double,
subBinWidth=double,
subInterval="string",
required parameter table
={
"caslib":"string",
"computedOnDemand":True | False,
"computedVars"
:[{
"format":"string",
"formattedLength":integer,
"label":"string",
required parameter "name":"variable-name",
"nfd":integer,
"nfl":integer
}<, {...}>],
"computedVarsProgram":"string",
"dataSourceOptions":{"key-1":{any-list-or-data-type-1} <, "key-2":{any-list-or-data-type-2}, ...>},
"groupBy"
:[{
"format":"string",
"formattedLength":integer,
"label":"string",
required parameter "name":"variable-name",
"nfd":integer,
"nfl":integer
}<, {...}>],
"groupByMode":"NOSORT" | "REDISTRIBUTE",
"importOptions":{"fileType":"ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters},
required parameter "name":"table-name",
"onDemand":True | False,
"orderBy"
:[{
"format":"string",
"formattedLength":integer,
"label":"string",
required parameter "name":"variable-name",
"nfd":integer,
"nfl":integer
}<, {...}>],
"singlePass":True | False,
"vars"
:[{
"format":"string",
"formattedLength":integer,
"label":"string",
required parameter "name":"variable-name",
"nfd":integer,
"nfl":integer
}<, {...}>],
"where":"where-expression",
"whereTable"
:{
"casLib":"string"
"dataSourceOptions":{adls_noreq-parameters | bigquery-parameters | cas_noreq-parameters | clouddex-parameters | db2-parameters | dnfs-parameters | esp-parameters | fedsvr-parameters | gcs_noreq-parameters | hadoop-parameters | hana-parameters | impala-parameters | jdbc-parameters | mongodb-parameters | mysql-parameters | odbc-parameters | oracle-parameters | path-parameters | postgres-parameters | redshift-parameters | s3-parameters | sapiq-parameters | sforce-parameters | singlestore_standard-parameters | snowflake-parameters | spark-parameters | spde-parameters | sqlserver-parameters | ss_noreq-parameters | teradata-parameters | vertica-parameters | yellowbrick-parameters}
"importOptions":{"fileType":"ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters}
required parameter "name":"table-name"
"vars"
:[{
"format":"string",
"formattedLength":integer,
"label":"string",
required parameter "name":"variable-name",
"nfd":integer,
"nfl":integer
}<, {...}>]
"where":"where-expression"
}
},
varSpecs
=[{
"ciAlpha":double,
"columnNames":["string-1" <, "string-2", ...>],
"edgeId":"variable-name",
"exclnpwgt":True | False,
"format":"string",
"formats":["string-1" <, "string-2", ...>],
"freq":"variable-name",
"freqStrict":True | False,
"includeMissing":True | False,
"k":integer,
"missDbl":double,
"missStr":"string",
"modeSingle":True | False,
"name":"variable-name",
"names":["variable-name-1" <, "variable-name-2", ...>],
"pctlDef":integer,
"percentile":[double-1 <, double-2, ...>],
"pN":double,
"pRange":[double-1 <, double-2, ...>],
"pRangeMax":double,
"pRangeMin":double,
"pStrN":"string",
"pStrRange":["string-1" <, "string-2", ...>],
"pStrRangeMax":"string",
"pStrRangeMin":"string",
"range":[double-1 <, double-2, ...>],
"rangeMax":double,
"rangeMin":double,
"strRange":["string-1" <, "string-2", ...>],
"strRangeMax":"string",
"strRangeMin":"string",
"summarySubset":["CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR"],
"weight":"variable-name"
}<, {...}>],
weight="variable-name",
windowBin=[double-1 <, double-2, ...>],
windowInt="string",
windowOffset=integer,
windowSubInt="string"
)
indicates a required parameter

Summary: Input and Output Tables

If a row includes a subparameter, you can specify the name, caslib, and so on in the subparameter. Otherwise, you can specify the name, caslib, and so on in the parameter.

Parameters for Reading Input Tables

Parameter

Subparameter

Description

required parametertable

—

specifies the table name, caslib, and other common parameters.

Parameters for Creating Output Tables

Parameter

Subparameter

Description

 casOut

—

specifies the settings for an output table.

Parameter Descriptions

align="BEGINNING" | "ENDING" | "MIDDLE"

specifies the alignment of the representative value with respect to an interval or bin.

BEGINNING

specifies to align at the beginning of an interval or bin. For example, the first day of the month is the beginning of an interval.

AliasesB
BEG
LEFT
ENDING

specifies to align at the last value of an interval or bin.

AliasesE
END
RIGHT
MIDDLE

specifies to align at the middle of an interval or bin.

AliasesM
MID

bin=[double-1 <, double-2, ...>]

specifies the minimum and maximum values of a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, then the action constructs a time series with 11 bins. The first bin is [-5, 5] and the last bin is [95, 105]. The values on the upper boundary of a bin belong to this bin. The values on the lower boundary of a bin belong to the adjacent lower bin. This parameter is ignored unless you also specify an ID variable.

casOut={casouttable}

specifies the settings for an output table.

For more information about specifying the casOut parameter, see the common casouttable parameter.

contribute="variable-name"

when the doESP parameter is True, you can specify a variable whose values within each aggregation interval are recorded. The value can be used as a key to join with the original table in order to understand each row contribution toward the aggregated interval.

contributeColumnLabel="string"

specifies a value to override the variable label from the contribute variable. By default, the contribute variable's label is shown in the results.

contributeColumnName="string"

specifies a value to override the variable name from the contribute variable. By default, the contribute variable's name is shown in the results.

contributeDelimiter="string"

specifies a delimiter that is used between concatenated values of the contribute variable.

Aliasdelimiter
Default","

contributeTrim=True | False

when set to True, leading and trailing blanks are removed from the formatted value of the contribute variable. This parameter is ignored if the contributeUnroll parameter is set to True.

DefaultFalse

contributeUnroll=True | False

by default, the formatted values from the contribute variable are concatenated together into a single row for the result table. When set to True, each raw value from the contribute variable adds a row to the result table.

Aliasunroll
DefaultFalse

copyVars=["variable-name-1" <, "variable-name-2", ...>]

specifies the variables to copy from the input table to the output table. The raw values are kept in the output. This parameter is ignored unless you also specify the groupBy parameter for the input table. When more than one record exists in a group, the minimum raw value is copied.

AliascopyVar

doESP=True | False

when set to True, the action can take advantage of partitioning and ordering on the input table. You must specify the groupBy parameter for the input table. The ID variable must be specified as the last groupBy parameter and in the orderBy parameter. Setting this parameter to True implies setting the keepRecord parameter to True. When set to False (the default value), the keepRecordId, excludeSelf, contribute, contributeColumnName, contributeTrim, contributeDelimiter, and contributeUnroll parameters are ignored.

AliaspartAndOrder
DefaultFalse

edgeId="variable-name"

specifies a numeric variable whose values are used to order the values of each varSpecs specification that uses the FIRST, LAST, FNE, or LNE aggregator. This parameter can be overridden in a varSpecs specification that includes an edgeId subparameter.

exclnpwgt=True | False

when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis.

AliasexcludeNonPositiveWeight
DefaultFalse

excludeSelf=True | False

when set to True and the doESP parameter is True, the aggregation excludes the current observation's contribution.

DefaultFalse

freq="variable-name"

specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used.

Aliasfrequency

freqStrict=True | False

this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded.

DefaultTrue

groupByLimit=64-bit-integer

specifies the maximum number of levels in a group-by set. When the server determines this number of levels, the server stops and does not return a result. Specify this parameter if you want to avoid creating large result sets in group-by operations.

Minimum value1

groupedIntervalOutput=True | False

when set to True, save only one of the same aggregated intervals with respect to the last Id value. The option is ignored if 'doESP' is set to False.

DefaultFalse

id="variable-name"

specifies a numeric variable that identifies the timestamp that is associated with each observation in the input table. The values are typically SAS DATE, TIME, or DATETIME values, but that is not required. The specified variable must also be specified in the groupBy parameter for the input table.

idEnd=double

specifies the inclusive maximum value of the ID variable to be considered in the analysis. If the maximum value of the ID variable is less than the idEnd value, the series is extended with missing values. If the last ID variable value is greater than the idEnd value, the series is truncated. This parameter is ignored unless you also specify an ID variable.

idOutputName="string"

specifies the new name of the ID variable in the output table

idRange=[double-1 <, double-2, ...>]

specifies the inclusive minimum and maximum values of the ID variable to be considered in the analysis. It is equivalent to specifying both idStart and idEnd.

idStart=double

specifies the inclusive minimum value of the ID variable to be considered in the analysis. If the minimum value of the ID variable is greater than the idStart value, then the series is prefixed with missing values. If the first ID variable value is less than the idStart value, then the series is truncated. This parameter is ignored unless you also specify an ID variable.

includeEmptyInterval=True | False

by default, intervals with a missing value for the ID variable are included in the output. When set to False, these intervals are excluded from the output.

AliasesincludeMissInterval
includeMissingInterval
DefaultTrue

includeMissing=True | False

by default, missing values are included in the analysis. When set to False, observations with missing values are excluded.

AliasesincludeMiss
incMissing
incMiss
DefaultTrue

inputs=[{casinvardesc-1} <, {casinvardesc-2}, ...>]

specifies the input variables to use in the analysis. For raw numeric variables, the default aggregator is SUMMARY. For all other situations, the default aggregator is N. You can specify variables in this parameter or exercise more control by specifying the varSpecs parameter, but you cannot use both.

For more information about specifying the inputs parameter, see the common casinvardesc parameter.

Aliasinput

interval="string"

specifies the time period for the accumulation of observations. For example, if you specify interval='MONTH', then the action summarizes the observations in monthly intervals. This parameter is ignored unless you also specify an ID variable.

jumpingWindow=True | False

when set to True, specifies that aggregation occurs over a time window that can contain multiple intervals and aggregation is reset when the specified time range elapses. By default, a window always retains the same multiple of intervals.

AliastumblingWindow
DefaultFalse

keepRecord=True | False

when set to True, each observation's original value for the ID variable is kept without performing interval alignment.

DefaultFalse

keepRecordId=True | False

when set to True and the doESP parameter is True, each observation's original ID value is kept without performing interval alignment.

DefaultFalse

modeSingle=True | False

this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value.

DefaultFalse

offset=integer

specifies the offset of each interval. If you specify offset=-1, then every interval that is derived from the data set is shifted one interval backward. For example, a timestamp value for March 1 is derived from the data set to become February 1.

AliasesintOffset
dif
intDif
intOff
Default0

partKey=["string-1" <, "string-2", ...>]

when the table is partitioned and you specify the partition parameter, you can specify a partition key so that the results are computed for the partition only.

pctlDef=integer

specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation.

Default5
Range1–5

pti=double

specifies the time value when the aggregation within an interval or a bin is terminated. For example, if you specify interval='MONTH' and partialToInterval='10FEB98'd, then the action aggregates only records from the first 10 days of each month.

Aliasesptd
partialToDate
partialToInterval
Default0
Minimum value0

ptw=double

specifies the subinterval with respect to each window interval. For example, if you specify windowInterval='MONTH' and partialToWindow='08FEB98'd, then the action counts only the first 8 days from JANUARY and the first 8 days from FEBURARY when it aggregates on window interval FEBURARY, ..., DECEMBER each year. This parameter is ignored unless you also specify the jumpingWindow parameter because the starting time varies for a sliding window (a non-jumping window).

AliaspartialToWindow
Default0
Minimum value0

raw=True | False

when set to True, raw values of the variables in the input parameter are used.

DefaultFalse

saveGroupbyFormat=True | False

by default, the formatted values of the groupBy variables from the input table are copied to the results. When set to False, the formatted values are not copied.

AliassaveGbyFmt
DefaultTrue

saveGroupbyRaw=True | False

by default, the raw values of the groupBy variables from the input table are copied to the results. When set to False, the raw values are not copied.

AliassaveGbyRaw
DefaultTrue

saveVariableColumn=True | False

by default, the variable name for each analysis variable is included in the results. The result table includes the name in a column that is named 'Column.' When set to False, this column is not included in the results.

AliassaveVarCol
DefaultTrue

saveVariableSpecification=True | False

by default, the results include a column that is named 'Variable Specification' to identify the varSpecs specification that produced the result. When set to False, this column is not included in the results.

AliassaveVarSpec
DefaultTrue

subBinOffset=double

specifies an offset from the beginning of a bin. The value must be positive and less than or equal to the bin width. If the specified value is out of range, this parameter is ignored. This parameter is ignored unless you specify an ID variable and the bin parameter.

subBinWidth=double

specifies the width of the sub bin within a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, subBinOffset=2, and subBinWidth=5, then the action summarizes only the observations with ID variable values that fall into [-2, 3], [8, 13], [18, 23], ..., [98, 103]. The specified value must be positive and the sum of the subBinOffset value and subBinWidth value must be less than or equal to the bin width. If the value is out of range, this parameter is ignored. This parameter is ignored unless you also specify an ID variable and the bin parameter.

Minimum value0

subInterval="string"

specifies a smaller interval to control the time period alignment within each interval for the aggregation of observations.

AliassubInt

* table={castable}

specifies the table name, caslib, and other common parameters.

For more information about specifying the table parameter, see the common castable parameter.

varSpecs=[{tkcasagg_varspecs-1} <, {tkcasagg_varspecs-2}, ...>]

specifies the variable to aggregate and the settings for the aggregator.

The tkcasagg_varspecs value can be one or more of the following:

"agg":"FIRST" | "FIRSTNOTEMPTY" | "LAST" | "LASTNOTEMPTY" | "MAXIMUM" | "MINIMUM" | "MODE" | "N" | "NDISTINCT" | "NMISS" | "NTOTAL" | "PERCENT" | "PERCENTILE" | "PGT" | "PLT" | "Q1" | "Q2" | "Q3" | "SUMMARY"

specifies the aggregator to apply to the analysis variable.

FIRST

returns the minimum value of the edgeId variable.

FIRSTNOTEMPTY

returns the minimum non-empty value of the edgeId variable.

AliasFNE
LAST

returns the maximum value of the edgeId variable.

LASTNOTEMPTY

returns the maximum non-empty value of the edgeId variable.

AliasLNE
MAXIMUM

returns the maximum nonmissing value.

AliasMAX
MINIMUM

returns the minimum nonmissing value.

AliasMIN
MODE

returns the most frequent value. You can specify the k parameter to return more than the most frequent values.

N

returns the number of observations, excluding missing values.

NDISTINCT

returns the number of distinct values. This is the default aggregator for character variables and numeric variables that have a format.

AliasNDIST
NMISS

returns the number of missing values.

NTOTAL

returns the number of observations, including missing values.

AliasNTTL
PERCENT

returns the percentage of values in the range that is specified in the pRange or pStrRange parameter.

AliasesPIN
PCIN
PERCENTILE

returns the statistics that are specified in the percentiles parameter.

PGT

returns the percentage of values that are greater than the threshold specified in the pN or pStrN parameter.

AliasPCGT
PLT

returns the percentage of values that are less than the threshold specified in the pN or pStrL parameter.

AliasPCLT
Q1

returns the value that is closest to the 25th percentile.

Q2

returns the value that is closest to the 50th percentile.

AliasesMED
MEDIAN
Q3

returns the value that is closest to the 75th percentile.

SUMMARY

returns the summary statistics for numeric variables including MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS. This is the default aggregator for raw numeric variables.

"ciAlpha":double

specifies the level of significance for 100*(1-ciAlpha)% confidence intervals. The default value of 0.05 results in 95% confidence intervals.

Default0.05
Range(0, 1)
"ciType":"LOWER" | "TWOSIDED" | "UPPER"

specifies the type of confidence interval.

DefaultTWOSIDED
LOWER

specifies to use the lower bound of where the true population mean is expected to lie, given the specified confidence.

AliasLEFT
TWOSIDED

specifies to use the two-sided confidence interval within which the true population mean is expected to lie, given the specified confidence.

UPPER

specifies to use the upper bound of where the true population mean is expected to lie, given the specified confidence.

AliasRIGHT
"columnNames":["string-1" <, "string-2", ...>]

specifies replacement column names to use in the results. By default, the name of the analysis variable is used as a column name in the result tables.

AliasescolName
colNames
RequirementThe specified values must be unique.
"edgeId":"variable-name"

specifies a numeric variable whose values are used to order the values of the analysis variable. This parameter applies to the FIRST, LAST, FNE, or LNE aggregators. Specifying this parameter in a varSpec parameter overrides the setting for the action.

"exclnpwgt":True | False

when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis. Specifying this parameter in a varSpec parameter overrides the setting for the action.

AliasexcludeNonPositiveWeight
DefaultFalse
"format":"string"

specifies a temporary format for the analysis variable.

"formats":["string-1" <, "string-2", ...>]

specifies a temporary format for the analysis variable.

"freq":"variable-name"

specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used. Specifying this parameter in a varSpec parameter overrides the setting for the action.

Aliasfrequency
"freqStrict":True | False

this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.

DefaultTrue
"includeMissing":True | False

by default, missing values are included in the analysis. When set to False, observations with missing values are excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.

AliasesincludeMiss
incMissing
incMiss
DefaultTrue
"k":integer

specifies the number of the most frequent items to collect for the MODE aggregator.

Default1
Range1–MACINT
"missDbl":double

specifies the numeric value to use for replacing the missing values.

"missStr":"string"

specifies the character value to use for replacing the missing values.

"modeSingle":True | False

this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value. Specifying this parameter in a varSpec parameter overrides the setting for the action.

DefaultFalse
"name":"variable-name"

specifies the analysis variable name.

Aliasvar
"names":["variable-name-1" <, "variable-name-2", ...>]

specifies the analysis variable name.

Aliasvars
"pctlDef":integer

specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation. Specifying this parameter in a varSpec parameter overrides the setting for the action.

Range1–5
"percentile":[double-1 <, double-2, ...>]

specifies the percentile to calculate when the aggregator is set to PERCENTILE.

Aliasespercentiles
pctl
pctls
RequirementThe specified values must be unique.
"pN":double

specifies the numeric threshold for the PGT and PLT aggregators on a numeric variable.

"pRange":[double-1 <, double-2, ...>]

specifies the inclusive minimum and maximum values for the PIN aggregator on a numeric variable. It is equivalent to specifying both the pRangeMin and pRangeMax parameters.

"pRangeMax":double

specifies the inclusive maximum value for the PIN aggregator on a numeric variable.

DefaultMACBIG
"pRangeMin":double

specifies the inclusive minimum value for the PIN aggregator on a numeric variable.

Default-MACBIG
"pStrN":"string"

specifies the character threshold for the PGT and PLT aggregators on a character variable.

"pStrRange":["string-1" <, "string-2", ...>]

specifies the inclusive minimum and maximum values for the PIN aggregator on a character variable. It is equivalent to specifying both the pStrRangeMin and pStrRangeMax parameters.

"pStrRangeMax":"string"

specifies the inclusive maximum value for the PIN aggregator on a character variable.

"pStrRangeMin":"string"

specifies the inclusive minimum value for the PIN aggregator on a character variable.

"range":[double-1 <, double-2, ...>]

specifies the inclusive minimum and maximum values of a numeric variable to be considered in the aggregation. It is equivalent to specifying both the rangeMin and rangeMax parameters.

"rangeMax":double

specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.

DefaultMACBIG
"rangeMin":double

specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.

Default-MACBIG
"strRange":["string-1" <, "string-2", ...>]

specifies the inclusive minimum and maximum values of a character variable to be considered in the aggregation. It is equivalent to specifying both the strRangeMin and strRangeMax parameters.

"strRangeMax":"string"

specifies the inclusive maximum value of a character variable to be considered in the aggregation.

"strRangeMin":"string"

specifies the inclusive minimum value of a character variable to be considered in the aggregation.

"summarySubset":["CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR"]

specifies the summary statistics to generate. By default, the column order of the summary statistics is MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS, regardless of the order that you specify. If you want the columns returned in a particular order, be sure to provide a name for each results column using the columnNames parameter.

Aliasesstatistics
subSet
RequirementThe specified values must be unique.
"weight":"variable-name"

specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior. Specifying this parameter in a varSpec parameter overrides the setting for the action.

weight="variable-name"

specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior.

windowBin=[double-1 <, double-2, ...>]

specifies the minimum and maximum values of a window bin. The specification and concepts are similar to the bin parameter, except the bins apply to intervals.

windowInt="string"

specifies the time window for the accumulation of observations with respect to each time interval. For example, if you specify interval='MONTH' and windowInt='YEAR', then the action summarizes one year's worth of observations in monthly intervals.

AliaseswinInt
windowInterval

windowOffset=integer

specifies the offset of each window interval. The effect is similar to how the offset parameter impacts the values for the interval parameter.

AliaseswindowIntOffset
winDif
winIntDif
winIntOff
windowIntervalOffset
Default0

windowSubBinOffset=double

specifies the starting point within a window bin in which record values are aggregated. For example, if you specify windowBin={0, 10} and windowSubBinOffset=2, then records with ID variable values in the interval [0, 2) are ignored. The specified value must not be larger than the window bin's width.

AliaswinSubBinOffset

windowSubBinWidth=double

specifies the width of the sub bin within each windowBin. The minimum acceptable value is 0, which renders windows ineffective. For example, if you specify windowBin={0, 10}, windowSubBinOffset=2, and windowSubBinWidth=5, then records with ID variable values in the intervals [0, 2) and [7, 10) are ignored.

AliaswinSubBinWidth
Minimum value0

windowSubInt="string"

this parameter is similar to subInterval. You can specify a smaller interval to control the sub time period alignment within each window interval for the aggregation of observations.

AliaseswinSubInterval
winSubInt
windowSubInterval

aggregate Action

Performs aggregation on selected variables.

Aggregate Data on Selected Columns
Aggregate Data on Selected Columns by Groups
Aggregate Data on Selected Columns by Date Intervals
Perform a Rolling Window Aggregation
results <– cas.aggregation.aggregate(s,
bin=list(double-1 <, double-2, ...>),
casOut
=list(
caslib="string",
compress=TRUE | FALSE,
indexVars=list("variable-name-1" <, "variable-name-2", ...>),
label="string",
lifetime=64-bit-integer,
maxMemSize=64-bit-integer,
memoryFormat="DVR" | "INHERIT" | "STANDARD",
name="table-name",
onDemand=TRUE | FALSE,
promote=TRUE | FALSE,
replace=TRUE | FALSE,
replication=integer,
threadBlockSize=64-bit-integer,
timeStamp="string",
where=list("string-1" <, "string-2", ...>)
),
contribute="variable-name",
contributeTrim=TRUE | FALSE,
contributeUnroll=TRUE | FALSE,
copyVars=list("variable-name-1" <, "variable-name-2", ...>),
doESP=TRUE | FALSE,
edgeId="variable-name",
exclnpwgt=TRUE | FALSE,
excludeSelf=TRUE | FALSE,
freq="variable-name",
freqStrict=TRUE | FALSE,
groupByLimit=64-bit-integer,
groupedIntervalOutput=TRUE | FALSE,
id="variable-name",
idEnd=double,
idOutputName="string",
idRange=list(double-1 <, double-2, ...>),
idStart=double,
includeEmptyInterval=TRUE | FALSE,
includeMissing=TRUE | FALSE,
inputs
=list( list(
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
) <, list(...)>),
interval="string",
jumpingWindow=TRUE | FALSE,
keepRecord=TRUE | FALSE,
keepRecordId=TRUE | FALSE,
modeSingle=TRUE | FALSE,
offset=integer,
partKey=list("string-1" <, "string-2", ...>),
pctlDef=integer,
pti=double,
ptw=double,
raw=TRUE | FALSE,
saveGroupbyFormat=TRUE | FALSE,
saveGroupbyRaw=TRUE | FALSE,
saveVariableColumn=TRUE | FALSE,
subBinOffset=double,
subBinWidth=double,
subInterval="string",
required parameter table
=list(
caslib="string",
computedOnDemand=TRUE | FALSE,
computedVars
=list( list(
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
) <, list(...)>),
computedVarsProgram="string",
dataSourceOptions=list(key-1=list(any-list-or-data-type-1) <, key-2=list(any-list-or-data-type-2), ...>),
groupBy
=list( list(
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
) <, list(...)>),
groupByMode="NOSORT" | "REDISTRIBUTE",
importOptions=list(fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters),
required parameter name="table-name",
onDemand=TRUE | FALSE,
orderBy
=list( list(
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
) <, list(...)>),
singlePass=TRUE | FALSE,
vars
=list( list(
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
) <, list(...)>),
where="where-expression",
whereTable
=list(
casLib="string"
dataSourceOptions=list(adls_noreq-parameters | bigquery-parameters | cas_noreq-parameters | clouddex-parameters | db2-parameters | dnfs-parameters | esp-parameters | fedsvr-parameters | gcs_noreq-parameters | hadoop-parameters | hana-parameters | impala-parameters | jdbc-parameters | mongodb-parameters | mysql-parameters | odbc-parameters | oracle-parameters | path-parameters | postgres-parameters | redshift-parameters | s3-parameters | sapiq-parameters | sforce-parameters | singlestore_standard-parameters | snowflake-parameters | spark-parameters | spde-parameters | sqlserver-parameters | ss_noreq-parameters | teradata-parameters | vertica-parameters | yellowbrick-parameters)
importOptions=list(fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters)
required parameter name="table-name"
vars
=list( list(
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
) <, list(...)>)
where="where-expression"
)
),
varSpecs
=list( list(
ciAlpha=double,
columnNames=list("string-1" <, "string-2", ...>),
edgeId="variable-name",
exclnpwgt=TRUE | FALSE,
format="string",
formats=list("string-1" <, "string-2", ...>),
freq="variable-name",
freqStrict=TRUE | FALSE,
includeMissing=TRUE | FALSE,
k=integer,
missDbl=double,
missStr="string",
modeSingle=TRUE | FALSE,
name="variable-name",
names=list("variable-name-1" <, "variable-name-2", ...>),
pctlDef=integer,
percentile=list(double-1 <, double-2, ...>),
pN=double,
pRange=list(double-1 <, double-2, ...>),
pRangeMax=double,
pRangeMin=double,
pStrN="string",
pStrRange=list("string-1" <, "string-2", ...>),
pStrRangeMax="string",
pStrRangeMin="string",
range=list(double-1 <, double-2, ...>),
rangeMax=double,
rangeMin=double,
strRange=list("string-1" <, "string-2", ...>),
strRangeMax="string",
strRangeMin="string",
summarySubset=list("CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR"),
weight="variable-name"
) <, list(...)>),
weight="variable-name",
windowBin=list(double-1 <, double-2, ...>),
windowInt="string",
windowOffset=integer,
windowSubInt="string"
)
indicates a required parameter

Summary: Input and Output Tables

If a row includes a subparameter, you can specify the name, caslib, and so on in the subparameter. Otherwise, you can specify the name, caslib, and so on in the parameter.

Parameters for Reading Input Tables

Parameter

Subparameter

Description

required parametertable

—

specifies the table name, caslib, and other common parameters.

Parameters for Creating Output Tables

Parameter

Subparameter

Description

 casOut

—

specifies the settings for an output table.

Parameter Descriptions

align="BEGINNING" | "ENDING" | "MIDDLE"

specifies the alignment of the representative value with respect to an interval or bin.

BEGINNING

specifies to align at the beginning of an interval or bin. For example, the first day of the month is the beginning of an interval.

AliasesB
BEG
LEFT
ENDING

specifies to align at the last value of an interval or bin.

AliasesE
END
RIGHT
MIDDLE

specifies to align at the middle of an interval or bin.

AliasesM
MID

bin=list(double-1 <, double-2, ...>)

specifies the minimum and maximum values of a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, then the action constructs a time series with 11 bins. The first bin is [-5, 5] and the last bin is [95, 105]. The values on the upper boundary of a bin belong to this bin. The values on the lower boundary of a bin belong to the adjacent lower bin. This parameter is ignored unless you also specify an ID variable.

casOut=list(casouttable)

specifies the settings for an output table.

For more information about specifying the casOut parameter, see the common casouttable parameter.

contribute="variable-name"

when the doESP parameter is True, you can specify a variable whose values within each aggregation interval are recorded. The value can be used as a key to join with the original table in order to understand each row contribution toward the aggregated interval.

contributeColumnLabel="string"

specifies a value to override the variable label from the contribute variable. By default, the contribute variable's label is shown in the results.

contributeColumnName="string"

specifies a value to override the variable name from the contribute variable. By default, the contribute variable's name is shown in the results.

contributeDelimiter="string"

specifies a delimiter that is used between concatenated values of the contribute variable.

Aliasdelimiter
Default","

contributeTrim=TRUE | FALSE

when set to True, leading and trailing blanks are removed from the formatted value of the contribute variable. This parameter is ignored if the contributeUnroll parameter is set to True.

DefaultFALSE

contributeUnroll=TRUE | FALSE

by default, the formatted values from the contribute variable are concatenated together into a single row for the result table. When set to True, each raw value from the contribute variable adds a row to the result table.

Aliasunroll
DefaultFALSE

copyVars=list("variable-name-1" <, "variable-name-2", ...>)

specifies the variables to copy from the input table to the output table. The raw values are kept in the output. This parameter is ignored unless you also specify the groupBy parameter for the input table. When more than one record exists in a group, the minimum raw value is copied.

AliascopyVar

doESP=TRUE | FALSE

when set to True, the action can take advantage of partitioning and ordering on the input table. You must specify the groupBy parameter for the input table. The ID variable must be specified as the last groupBy parameter and in the orderBy parameter. Setting this parameter to True implies setting the keepRecord parameter to True. When set to False (the default value), the keepRecordId, excludeSelf, contribute, contributeColumnName, contributeTrim, contributeDelimiter, and contributeUnroll parameters are ignored.

AliaspartAndOrder
DefaultFALSE

edgeId="variable-name"

specifies a numeric variable whose values are used to order the values of each varSpecs specification that uses the FIRST, LAST, FNE, or LNE aggregator. This parameter can be overridden in a varSpecs specification that includes an edgeId subparameter.

exclnpwgt=TRUE | FALSE

when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis.

AliasexcludeNonPositiveWeight
DefaultFALSE

excludeSelf=TRUE | FALSE

when set to True and the doESP parameter is True, the aggregation excludes the current observation's contribution.

DefaultFALSE

freq="variable-name"

specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used.

Aliasfrequency

freqStrict=TRUE | FALSE

this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded.

DefaultTRUE

groupByLimit=64-bit-integer

specifies the maximum number of levels in a group-by set. When the server determines this number of levels, the server stops and does not return a result. Specify this parameter if you want to avoid creating large result sets in group-by operations.

Minimum value1

groupedIntervalOutput=TRUE | FALSE

when set to True, save only one of the same aggregated intervals with respect to the last Id value. The option is ignored if 'doESP' is set to False.

DefaultFALSE

id="variable-name"

specifies a numeric variable that identifies the timestamp that is associated with each observation in the input table. The values are typically SAS DATE, TIME, or DATETIME values, but that is not required. The specified variable must also be specified in the groupBy parameter for the input table.

idEnd=double

specifies the inclusive maximum value of the ID variable to be considered in the analysis. If the maximum value of the ID variable is less than the idEnd value, the series is extended with missing values. If the last ID variable value is greater than the idEnd value, the series is truncated. This parameter is ignored unless you also specify an ID variable.

idOutputName="string"

specifies the new name of the ID variable in the output table

idRange=list(double-1 <, double-2, ...>)

specifies the inclusive minimum and maximum values of the ID variable to be considered in the analysis. It is equivalent to specifying both idStart and idEnd.

idStart=double

specifies the inclusive minimum value of the ID variable to be considered in the analysis. If the minimum value of the ID variable is greater than the idStart value, then the series is prefixed with missing values. If the first ID variable value is less than the idStart value, then the series is truncated. This parameter is ignored unless you also specify an ID variable.

includeEmptyInterval=TRUE | FALSE

by default, intervals with a missing value for the ID variable are included in the output. When set to False, these intervals are excluded from the output.

AliasesincludeMissInterval
includeMissingInterval
DefaultTRUE

includeMissing=TRUE | FALSE

by default, missing values are included in the analysis. When set to False, observations with missing values are excluded.

AliasesincludeMiss
incMissing
incMiss
DefaultTRUE

inputs=list( list(casinvardesc-1) <, list(casinvardesc-2), ...>)

specifies the input variables to use in the analysis. For raw numeric variables, the default aggregator is SUMMARY. For all other situations, the default aggregator is N. You can specify variables in this parameter or exercise more control by specifying the varSpecs parameter, but you cannot use both.

For more information about specifying the inputs parameter, see the common casinvardesc parameter.

Aliasinput

interval="string"

specifies the time period for the accumulation of observations. For example, if you specify interval='MONTH', then the action summarizes the observations in monthly intervals. This parameter is ignored unless you also specify an ID variable.

jumpingWindow=TRUE | FALSE

when set to True, specifies that aggregation occurs over a time window that can contain multiple intervals and aggregation is reset when the specified time range elapses. By default, a window always retains the same multiple of intervals.

AliastumblingWindow
DefaultFALSE

keepRecord=TRUE | FALSE

when set to True, each observation's original value for the ID variable is kept without performing interval alignment.

DefaultFALSE

keepRecordId=TRUE | FALSE

when set to True and the doESP parameter is True, each observation's original ID value is kept without performing interval alignment.

DefaultFALSE

modeSingle=TRUE | FALSE

this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value.

DefaultFALSE

offset=integer

specifies the offset of each interval. If you specify offset=-1, then every interval that is derived from the data set is shifted one interval backward. For example, a timestamp value for March 1 is derived from the data set to become February 1.

AliasesintOffset
dif
intDif
intOff
Default0

partKey=list("string-1" <, "string-2", ...>)

when the table is partitioned and you specify the partition parameter, you can specify a partition key so that the results are computed for the partition only.

pctlDef=integer

specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation.

Default5
Range1–5

pti=double

specifies the time value when the aggregation within an interval or a bin is terminated. For example, if you specify interval='MONTH' and partialToInterval='10FEB98'd, then the action aggregates only records from the first 10 days of each month.

Aliasesptd
partialToDate
partialToInterval
Default0
Minimum value0

ptw=double

specifies the subinterval with respect to each window interval. For example, if you specify windowInterval='MONTH' and partialToWindow='08FEB98'd, then the action counts only the first 8 days from JANUARY and the first 8 days from FEBURARY when it aggregates on window interval FEBURARY, ..., DECEMBER each year. This parameter is ignored unless you also specify the jumpingWindow parameter because the starting time varies for a sliding window (a non-jumping window).

AliaspartialToWindow
Default0
Minimum value0

raw=TRUE | FALSE

when set to True, raw values of the variables in the input parameter are used.

DefaultFALSE

saveGroupbyFormat=TRUE | FALSE

by default, the formatted values of the groupBy variables from the input table are copied to the results. When set to False, the formatted values are not copied.

AliassaveGbyFmt
DefaultTRUE

saveGroupbyRaw=TRUE | FALSE

by default, the raw values of the groupBy variables from the input table are copied to the results. When set to False, the raw values are not copied.

AliassaveGbyRaw
DefaultTRUE

saveVariableColumn=TRUE | FALSE

by default, the variable name for each analysis variable is included in the results. The result table includes the name in a column that is named 'Column.' When set to False, this column is not included in the results.

AliassaveVarCol
DefaultTRUE

saveVariableSpecification=TRUE | FALSE

by default, the results include a column that is named 'Variable Specification' to identify the varSpecs specification that produced the result. When set to False, this column is not included in the results.

AliassaveVarSpec
DefaultTRUE

subBinOffset=double

specifies an offset from the beginning of a bin. The value must be positive and less than or equal to the bin width. If the specified value is out of range, this parameter is ignored. This parameter is ignored unless you specify an ID variable and the bin parameter.

subBinWidth=double

specifies the width of the sub bin within a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, subBinOffset=2, and subBinWidth=5, then the action summarizes only the observations with ID variable values that fall into [-2, 3], [8, 13], [18, 23], ..., [98, 103]. The specified value must be positive and the sum of the subBinOffset value and subBinWidth value must be less than or equal to the bin width. If the value is out of range, this parameter is ignored. This parameter is ignored unless you also specify an ID variable and the bin parameter.

Minimum value0

subInterval="string"

specifies a smaller interval to control the time period alignment within each interval for the aggregation of observations.

AliassubInt

* table=list(castable)

specifies the table name, caslib, and other common parameters.

For more information about specifying the table parameter, see the common castable parameter.

varSpecs=list( list(tkcasagg_varspecs-1) <, list(tkcasagg_varspecs-2), ...>)

specifies the variable to aggregate and the settings for the aggregator.

The tkcasagg_varspecs value can be one or more of the following:

agg="FIRST" | "FIRSTNOTEMPTY" | "LAST" | "LASTNOTEMPTY" | "MAXIMUM" | "MINIMUM" | "MODE" | "N" | "NDISTINCT" | "NMISS" | "NTOTAL" | "PERCENT" | "PERCENTILE" | "PGT" | "PLT" | "Q1" | "Q2" | "Q3" | "SUMMARY"

specifies the aggregator to apply to the analysis variable.

FIRST

returns the minimum value of the edgeId variable.

FIRSTNOTEMPTY

returns the minimum non-empty value of the edgeId variable.

AliasFNE
LAST

returns the maximum value of the edgeId variable.

LASTNOTEMPTY

returns the maximum non-empty value of the edgeId variable.

AliasLNE
MAXIMUM

returns the maximum nonmissing value.

AliasMAX
MINIMUM

returns the minimum nonmissing value.

AliasMIN
MODE

returns the most frequent value. You can specify the k parameter to return more than the most frequent values.

N

returns the number of observations, excluding missing values.

NDISTINCT

returns the number of distinct values. This is the default aggregator for character variables and numeric variables that have a format.

AliasNDIST
NMISS

returns the number of missing values.

NTOTAL

returns the number of observations, including missing values.

AliasNTTL
PERCENT

returns the percentage of values in the range that is specified in the pRange or pStrRange parameter.

AliasesPIN
PCIN
PERCENTILE

returns the statistics that are specified in the percentiles parameter.

PGT

returns the percentage of values that are greater than the threshold specified in the pN or pStrN parameter.

AliasPCGT
PLT

returns the percentage of values that are less than the threshold specified in the pN or pStrL parameter.

AliasPCLT
Q1

returns the value that is closest to the 25th percentile.

Q2

returns the value that is closest to the 50th percentile.

AliasesMED
MEDIAN
Q3

returns the value that is closest to the 75th percentile.

SUMMARY

returns the summary statistics for numeric variables including MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS. This is the default aggregator for raw numeric variables.

ciAlpha=double

specifies the level of significance for 100*(1-ciAlpha)% confidence intervals. The default value of 0.05 results in 95% confidence intervals.

Default0.05
Range(0, 1)
ciType="LOWER" | "TWOSIDED" | "UPPER"

specifies the type of confidence interval.

DefaultTWOSIDED
LOWER

specifies to use the lower bound of where the true population mean is expected to lie, given the specified confidence.

AliasLEFT
TWOSIDED

specifies to use the two-sided confidence interval within which the true population mean is expected to lie, given the specified confidence.

UPPER

specifies to use the upper bound of where the true population mean is expected to lie, given the specified confidence.

AliasRIGHT
columnNames=list("string-1" <, "string-2", ...>)

specifies replacement column names to use in the results. By default, the name of the analysis variable is used as a column name in the result tables.

AliasescolName
colNames
RequirementThe specified values must be unique.
edgeId="variable-name"

specifies a numeric variable whose values are used to order the values of the analysis variable. This parameter applies to the FIRST, LAST, FNE, or LNE aggregators. Specifying this parameter in a varSpec parameter overrides the setting for the action.

exclnpwgt=TRUE | FALSE

when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis. Specifying this parameter in a varSpec parameter overrides the setting for the action.

AliasexcludeNonPositiveWeight
DefaultFALSE
format="string"

specifies a temporary format for the analysis variable.

formats=list("string-1" <, "string-2", ...>)

specifies a temporary format for the analysis variable.

freq="variable-name"

specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used. Specifying this parameter in a varSpec parameter overrides the setting for the action.

Aliasfrequency
freqStrict=TRUE | FALSE

this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.

DefaultTRUE
includeMissing=TRUE | FALSE

by default, missing values are included in the analysis. When set to False, observations with missing values are excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.

AliasesincludeMiss
incMissing
incMiss
DefaultTRUE
k=integer

specifies the number of the most frequent items to collect for the MODE aggregator.

Default1
Range1–MACINT
missDbl=double

specifies the numeric value to use for replacing the missing values.

missStr="string"

specifies the character value to use for replacing the missing values.

modeSingle=TRUE | FALSE

this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value. Specifying this parameter in a varSpec parameter overrides the setting for the action.

DefaultFALSE
name="variable-name"

specifies the analysis variable name.

Aliasvar
names=list("variable-name-1" <, "variable-name-2", ...>)

specifies the analysis variable name.

Aliasvars
pctlDef=integer

specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation. Specifying this parameter in a varSpec parameter overrides the setting for the action.

Range1–5
percentile=list(double-1 <, double-2, ...>)

specifies the percentile to calculate when the aggregator is set to PERCENTILE.

Aliasespercentiles
pctl
pctls
RequirementThe specified values must be unique.
pN=double

specifies the numeric threshold for the PGT and PLT aggregators on a numeric variable.

pRange=list(double-1 <, double-2, ...>)

specifies the inclusive minimum and maximum values for the PIN aggregator on a numeric variable. It is equivalent to specifying both the pRangeMin and pRangeMax parameters.

pRangeMax=double

specifies the inclusive maximum value for the PIN aggregator on a numeric variable.

DefaultMACBIG
pRangeMin=double

specifies the inclusive minimum value for the PIN aggregator on a numeric variable.

Default-MACBIG
pStrN="string"

specifies the character threshold for the PGT and PLT aggregators on a character variable.

pStrRange=list("string-1" <, "string-2", ...>)

specifies the inclusive minimum and maximum values for the PIN aggregator on a character variable. It is equivalent to specifying both the pStrRangeMin and pStrRangeMax parameters.

pStrRangeMax="string"

specifies the inclusive maximum value for the PIN aggregator on a character variable.

pStrRangeMin="string"

specifies the inclusive minimum value for the PIN aggregator on a character variable.

range=list(double-1 <, double-2, ...>)

specifies the inclusive minimum and maximum values of a numeric variable to be considered in the aggregation. It is equivalent to specifying both the rangeMin and rangeMax parameters.

rangeMax=double

specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.

DefaultMACBIG
rangeMin=double

specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.

Default-MACBIG
strRange=list("string-1" <, "string-2", ...>)

specifies the inclusive minimum and maximum values of a character variable to be considered in the aggregation. It is equivalent to specifying both the strRangeMin and strRangeMax parameters.

strRangeMax="string"

specifies the inclusive maximum value of a character variable to be considered in the aggregation.

strRangeMin="string"

specifies the inclusive minimum value of a character variable to be considered in the aggregation.

summarySubset=list("CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR")

specifies the summary statistics to generate. By default, the column order of the summary statistics is MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS, regardless of the order that you specify. If you want the columns returned in a particular order, be sure to provide a name for each results column using the columnNames parameter.

Aliasesstatistics
subSet
RequirementThe specified values must be unique.
weight="variable-name"

specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior. Specifying this parameter in a varSpec parameter overrides the setting for the action.

weight="variable-name"

specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior.

windowBin=list(double-1 <, double-2, ...>)

specifies the minimum and maximum values of a window bin. The specification and concepts are similar to the bin parameter, except the bins apply to intervals.

windowInt="string"

specifies the time window for the accumulation of observations with respect to each time interval. For example, if you specify interval='MONTH' and windowInt='YEAR', then the action summarizes one year's worth of observations in monthly intervals.

AliaseswinInt
windowInterval

windowOffset=integer

specifies the offset of each window interval. The effect is similar to how the offset parameter impacts the values for the interval parameter.

AliaseswindowIntOffset
winDif
winIntDif
winIntOff
windowIntervalOffset
Default0

windowSubBinOffset=double

specifies the starting point within a window bin in which record values are aggregated. For example, if you specify windowBin={0, 10} and windowSubBinOffset=2, then records with ID variable values in the interval [0, 2) are ignored. The specified value must not be larger than the window bin's width.

AliaswinSubBinOffset

windowSubBinWidth=double

specifies the width of the sub bin within each windowBin. The minimum acceptable value is 0, which renders windows ineffective. For example, if you specify windowBin={0, 10}, windowSubBinOffset=2, and windowSubBinWidth=5, then records with ID variable values in the intervals [0, 2) and [7, 10) are ignored.

AliaswinSubBinWidth
Minimum value0

windowSubInt="string"

this parameter is similar to subInterval. You can specify a smaller interval to control the sub time period alignment within each window interval for the aggregation of observations.

AliaseswinSubInterval
winSubInt
windowSubInterval
Last updated: February 15, 2023