Table Action Set: Syntax

Provides actions for accessing and managing data

fetch Action

Fetches rows from a table or view.

View Rows from a Table
table.fetch <result=results> <status=rc> /
fetchVars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
format=TRUE | FALSE,
from=64-bit-integer,
index=TRUE | FALSE,
maxRows=integer,
sasTypes=TRUE | FALSE,
sortBy
={{
formatted="FORMATTED" | "RAW",
required parameter name="variable-name",
order="ASCENDING" | "DESCENDING"
}, {...}},
sortLocale="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",
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 | greenplum-parameters | hadoop-parameters | hana-parameters | hdfs-parameters | impala-parameters | informix-parameters | jdbc-parameters | mongodb-parameters | mysql-parameters | netezza-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"
}
},
to=64-bit-integer
;
indicates a required parameter

Summary: Input 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.

Parameter Descriptions

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

specifies the column names from the input table. If you do not specify this parameter, then all columns are fetched.

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

format=TRUE | FALSE

when set to True, formats are applied to the variables.

DefaultFALSE

from=64-bit-integer

specifies the ordinal position of the first row to return.

Default1

index=TRUE | FALSE

when set to True, adds a column named Index to the results that is to identify each row.

DefaultTRUE

maxRows=integer

specifies the maximum number of rows to return per result table. The fetch action result table is divided into multiple result tables with a maximum row number set by the maxrows parameter. If you specify maxrows=0, then the fetch action does not return any rows.

Default1000

sasTypes=TRUE | FALSE

when set to True, converts data to fixed-width character and double data types.

DefaultTRUE

sortBy={{fetchorderbyelement-1} <, {fetchorderbyelement-2}, ...>}

specifies the variables and variable settings for sorting results.

AliasorderBy

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

formatted="FORMATTED" | "RAW"

specifies whether the formatted or raw value for the variable is used.

DefaultRAW
* name="variable-name"

specifies the variable name to use for sorting.

order="ASCENDING" | "DESCENDING"

specifies whether the ascending or descending value for the variable is used.

DefaultASCENDING

sortLocale="string"

Locale to use for comparisons during sort.

sortMethodCutoff=double

specifies the cutoff point for choosing between two sort methods.

Default2
Range0–100

* table={castable}

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

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

to=64-bit-integer

specifies the ordinal position of the last row to return.

Default20

fetch Action

Fetches rows from a table or view.

View Rows from a Table
results, info = s:table_fetch{
fetchVars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
format=true | false,
from=64-bit-integer,
index=true | false,
maxRows=integer,
sasTypes=true | false,
sortBy
={{
formatted="FORMATTED" | "RAW",
required parameter name="variable-name",
order="ASCENDING" | "DESCENDING"
}, {...}},
sortLocale="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",
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 | greenplum-parameters | hadoop-parameters | hana-parameters | hdfs-parameters | impala-parameters | informix-parameters | jdbc-parameters | mongodb-parameters | mysql-parameters | netezza-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"
}
},
to=64-bit-integer
}
indicates a required parameter

Summary: Input 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.

Parameter Descriptions

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

specifies the column names from the input table. If you do not specify this parameter, then all columns are fetched.

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

format=true | false

when set to True, formats are applied to the variables.

Defaultfalse

from=64-bit-integer

specifies the ordinal position of the first row to return.

Default1

index=true | false

when set to True, adds a column named Index to the results that is to identify each row.

Defaulttrue

maxRows=integer

specifies the maximum number of rows to return per result table. The fetch action result table is divided into multiple result tables with a maximum row number set by the maxrows parameter. If you specify maxrows=0, then the fetch action does not return any rows.

Default1000

sasTypes=true | false

when set to True, converts data to fixed-width character and double data types.

Defaulttrue

sortBy={{fetchorderbyelement-1} <, {fetchorderbyelement-2}, ...>}

specifies the variables and variable settings for sorting results.

AliasorderBy

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

formatted="FORMATTED" | "RAW"

specifies whether the formatted or raw value for the variable is used.

DefaultRAW
* name="variable-name"

specifies the variable name to use for sorting.

order="ASCENDING" | "DESCENDING"

specifies whether the ascending or descending value for the variable is used.

DefaultASCENDING

sortLocale="string"

Locale to use for comparisons during sort.

sortMethodCutoff=double

specifies the cutoff point for choosing between two sort methods.

Default2
Range0–100

* table={castable}

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

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

to=64-bit-integer

specifies the ordinal position of the last row to return.

Default20

fetch Action

Fetches rows from a table or view.

View Rows from a Table
results=s.table.fetch(
fetchVars
=[{
"format":"string",
"formattedLength":integer,
"label":"string",
required parameter "name":"variable-name",
"nfd":integer,
"nfl":integer
}<, {...}>],
format=True | False,
from_=64-bit-integer,
index=True | False,
maxRows=integer,
sasTypes=True | False,
sortBy
=[{
"formatted":"FORMATTED" | "RAW",
required parameter "name":"variable-name",
"order":"ASCENDING" | "DESCENDING"
}<, {...}>],
sortLocale="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",
"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 | greenplum-parameters | hadoop-parameters | hana-parameters | hdfs-parameters | impala-parameters | informix-parameters | jdbc-parameters | mongodb-parameters | mysql-parameters | netezza-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"
}
},
to=64-bit-integer
)
indicates a required parameter

Summary: Input 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.

Parameter Descriptions

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

specifies the column names from the input table. If you do not specify this parameter, then all columns are fetched.

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

format=True | False

when set to True, formats are applied to the variables.

DefaultFalse

from_=64-bit-integer

specifies the ordinal position of the first row to return.

Default1

index=True | False

when set to True, adds a column named Index to the results that is to identify each row.

DefaultTrue

maxRows=integer

specifies the maximum number of rows to return per result table. The fetch action result table is divided into multiple result tables with a maximum row number set by the maxrows parameter. If you specify maxrows=0, then the fetch action does not return any rows.

Default1000

sasTypes=True | False

when set to True, converts data to fixed-width character and double data types.

DefaultTrue

sortBy=[{fetchorderbyelement-1} <, {fetchorderbyelement-2}, ...>]

specifies the variables and variable settings for sorting results.

AliasorderBy

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

"formatted":"FORMATTED" | "RAW"

specifies whether the formatted or raw value for the variable is used.

DefaultRAW
* "name":"variable-name"

specifies the variable name to use for sorting.

"order":"ASCENDING" | "DESCENDING"

specifies whether the ascending or descending value for the variable is used.

DefaultASCENDING

sortLocale="string"

Locale to use for comparisons during sort.

sortMethodCutoff=double

specifies the cutoff point for choosing between two sort methods.

Default2
Range0–100

* table={castable}

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

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

to=64-bit-integer

specifies the ordinal position of the last row to return.

Default20

fetch Action

Fetches rows from a table or view.

View Rows from a Table
results <– cas.table.fetch(s,
fetchVars
=list( list(
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
) <, list(...)>),
format=TRUE | FALSE,
from=64-bit-integer,
index=TRUE | FALSE,
maxRows=integer,
sasTypes=TRUE | FALSE,
sortBy
=list( list(
formatted="FORMATTED" | "RAW",
required parameter name="variable-name",
order="ASCENDING" | "DESCENDING"
) <, list(...)>),
sortLocale="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",
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 | greenplum-parameters | hadoop-parameters | hana-parameters | hdfs-parameters | impala-parameters | informix-parameters | jdbc-parameters | mongodb-parameters | mysql-parameters | netezza-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"
)
),
to=64-bit-integer
)
indicates a required parameter

Summary: Input 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.

Parameter Descriptions

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

specifies the column names from the input table. If you do not specify this parameter, then all columns are fetched.

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

format=TRUE | FALSE

when set to True, formats are applied to the variables.

DefaultFALSE

from=64-bit-integer

specifies the ordinal position of the first row to return.

Default1

index=TRUE | FALSE

when set to True, adds a column named Index to the results that is to identify each row.

DefaultTRUE

maxRows=integer

specifies the maximum number of rows to return per result table. The fetch action result table is divided into multiple result tables with a maximum row number set by the maxrows parameter. If you specify maxrows=0, then the fetch action does not return any rows.

Default1000

sasTypes=TRUE | FALSE

when set to True, converts data to fixed-width character and double data types.

DefaultTRUE

sortBy=list( list(fetchorderbyelement-1) <, list(fetchorderbyelement-2), ...>)

specifies the variables and variable settings for sorting results.

AliasorderBy

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

formatted="FORMATTED" | "RAW"

specifies whether the formatted or raw value for the variable is used.

DefaultRAW
* name="variable-name"

specifies the variable name to use for sorting.

order="ASCENDING" | "DESCENDING"

specifies whether the ascending or descending value for the variable is used.

DefaultASCENDING

sortLocale="string"

Locale to use for comparisons during sort.

sortMethodCutoff=double

specifies the cutoff point for choosing between two sort methods.

Default2
Range0–100

* 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.

to=64-bit-integer

specifies the ordinal position of the last row to return.

Default20
Last updated: November 18, 2025