Table Action Set: Syntax

Provides actions for accessing and managing data

view Action

Creates a view from files or tables.

Tip:The keys parameter must be specified if you use the action with more than one table.
Create a View with Two Tables
table.view <result=results> <status=rc> /
caslib="string",
leftJoin=TRUE | FALSE,
required parameter name="string",
promote=TRUE | FALSE,
replace=TRUE | FALSE,
tables
={{
as="string",
caslib="string",
computedVars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
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},
keys={"string-1" <, "string-2", ...>},
required parameter name="table-name",
prefixColumnNames=TRUE | FALSE,
varList={"variable-name-1" <, "variable-name-2", ...>},
vars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
where="where-expression"
}, {...}}
;
indicates a required parameter

Parameter Descriptions

caslib="string"

specifies the target caslib for the view.

AliastargetLib

leftJoin=TRUE | FALSE

when set to True, missing values are produced for columns in a dimension table that do not match the keys in the fact table. When False, the default, no result row is produced when a dimension table's keys do not match the fact table.

DefaultFALSE

* name="string"

specifies the name for the view to create.

promote=TRUE | FALSE

when set to True, the view is added with a global scope. This enables other sessions to access the table, subject to access controls. The target caslib must also have a global scope.

DefaultFALSE

replace=TRUE | FALSE

specifies whether to overwrite an existing view with the same name.

DefaultFALSE

tables={{casview-1} <, {casview-2}, ...>}

specifies the input tables to use for the view.

Minimum items1

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

as="string"

specifies a table alias for the table. By default, this table alias and an underscore are used as a column name prefix for the columns contributed by this table. Use the prefixColumnNames parameter to disable the default behavior.

caslib="string"

specifies the caslib that is used by the input table.

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

specifies the names of the computed variables to create. Specify an expression for each variable in the computedVarsProgram parameter. If you do not specify this parameter, then all variables from computedVarsProgram are automatically included.

For more information about specifying the computedVars parameter, see Basic Syntax in SAS Cloud Analytic Services: CASL Programmer’s Guide.

computedVarsProgram="string"

specifies an expression for each computed variable that you include in the computedVars parameter.

AliascompPgm
importOptions={fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters}

specifies the settings for reading a table from a data source.

Aliasimport

For more information about specifying the importOptions parameter, see the common importOptions parameter.

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

specifies the relationship between tables. The keys are checked to make sure they are valid when you run the action. The format is "table1-column=table2-column". Specify this parameter for dimension tables (table1) only. It does not apply to fact tables (table2).

Aliasjoinkey
* name="table-name"

specifies the name for the view to create.

prefixColumnNames=TRUE | FALSE

when set to False, the column names from the contributing table are used as-is. By default, the column names are prefixed with either tn_ or the value specified in the as parameter and an underscore. This behavior is applied only to the table that plays the role of the fact table.

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

specifies the variables to use in the action.

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

specifies the variables to use in the action.

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

where="where-expression"

specifies an expression for subsetting the input data.

Result Descriptions

caslib

The result is a string. You can access the value from results.caslib.

viewName

The result is a string. You can access the value from results.viewName.

view Action

Creates a view from files or tables.

Tip:The keys parameter must be specified if you use the action with more than one table.
Create a View with Two Tables
results, info = s:table_view{
caslib="string",
leftJoin=true | false,
required parameter name="string",
promote=true | false,
replace=true | false,
tables
={{
as="string",
caslib="string",
computedVars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
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},
keys={"string-1" <, "string-2", ...>},
required parameter name="table-name",
prefixColumnNames=true | false,
varList={"variable-name-1" <, "variable-name-2", ...>},
vars
={{
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
}, {...}},
where="where-expression"
}, {...}}
}
indicates a required parameter

Parameter Descriptions

caslib="string"

specifies the target caslib for the view.

AliastargetLib

leftJoin=true | false

when set to True, missing values are produced for columns in a dimension table that do not match the keys in the fact table. When False, the default, no result row is produced when a dimension table's keys do not match the fact table.

Defaultfalse

* name="string"

specifies the name for the view to create.

promote=true | false

when set to True, the view is added with a global scope. This enables other sessions to access the table, subject to access controls. The target caslib must also have a global scope.

Defaultfalse

replace=true | false

specifies whether to overwrite an existing view with the same name.

Defaultfalse

tables={{casview-1} <, {casview-2}, ...>}

specifies the input tables to use for the view.

Minimum items1

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

as="string"

specifies a table alias for the table. By default, this table alias and an underscore are used as a column name prefix for the columns contributed by this table. Use the prefixColumnNames parameter to disable the default behavior.

caslib="string"

specifies the caslib that is used by the input table.

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

specifies the names of the computed variables to create. Specify an expression for each variable in the computedVarsProgram parameter. If you do not specify this parameter, then all variables from computedVarsProgram are automatically included.

For more information about specifying the computedVars parameter, see Basic Syntax in SAS Cloud Analytic Services: CASL Programmer’s Guide.

computedVarsProgram="string"

specifies an expression for each computed variable that you include in the computedVars parameter.

AliascompPgm
importOptions={fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters}

specifies the settings for reading a table from a data source.

Aliasimport

For more information about specifying the importOptions parameter, see the common importOptions parameter.

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

specifies the relationship between tables. The keys are checked to make sure they are valid when you run the action. The format is "table1-column=table2-column". Specify this parameter for dimension tables (table1) only. It does not apply to fact tables (table2).

Aliasjoinkey
* name="table-name"

specifies the name for the view to create.

prefixColumnNames=true | false

when set to False, the column names from the contributing table are used as-is. By default, the column names are prefixed with either tn_ or the value specified in the as parameter and an underscore. This behavior is applied only to the table that plays the role of the fact table.

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

specifies the variables to use in the action.

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

specifies the variables to use in the action.

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

where="where-expression"

specifies an expression for subsetting the input data.

Result Descriptions

caslib

The result is a string. You can access the value from results.caslib.

viewName

The result is a string. You can access the value from results.viewName.

view Action

Creates a view from files or tables.

Tip:The keys parameter must be specified if you use the action with more than one table.
Create a View with Two Tables
results=s.table.view(
caslib="string",
leftJoin=True | False,
required parameter name="string",
promote=True | False,
replace=True | False,
tables
=[{
"as_":"string",
"caslib":"string",
"computedVars"
:[{
"format":"string",
"formattedLength":integer,
"label":"string",
required parameter "name":"variable-name",
"nfd":integer,
"nfl":integer
}<, {...}>],
"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},
"keys":["string-1" <, "string-2", ...>],
required parameter "name":"table-name",
"prefixColumnNames":True | False,
"varList":["variable-name-1" <, "variable-name-2", ...>],
"vars"
:[{
"format":"string",
"formattedLength":integer,
"label":"string",
required parameter "name":"variable-name",
"nfd":integer,
"nfl":integer
}<, {...}>],
"where":"where-expression"
}<, {...}>]
)
indicates a required parameter

Parameter Descriptions

caslib="string"

specifies the target caslib for the view.

AliastargetLib

leftJoin=True | False

when set to True, missing values are produced for columns in a dimension table that do not match the keys in the fact table. When False, the default, no result row is produced when a dimension table's keys do not match the fact table.

DefaultFalse

* name="string"

specifies the name for the view to create.

promote=True | False

when set to True, the view is added with a global scope. This enables other sessions to access the table, subject to access controls. The target caslib must also have a global scope.

DefaultFalse

replace=True | False

specifies whether to overwrite an existing view with the same name.

DefaultFalse

tables=[{casview-1} <, {casview-2}, ...>]

specifies the input tables to use for the view.

Minimum items1

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

"as_":"string"

specifies a table alias for the table. By default, this table alias and an underscore are used as a column name prefix for the columns contributed by this table. Use the prefixColumnNames parameter to disable the default behavior.

"caslib":"string"

specifies the caslib that is used by the input table.

"computedVars":[{casinvardesc-1} <, {casinvardesc-2}, ...>]

specifies the names of the computed variables to create. Specify an expression for each variable in the computedVarsProgram parameter. If you do not specify this parameter, then all variables from computedVarsProgram are automatically included.

For more information about specifying the computedVars parameter, see Basic Syntax in SAS Cloud Analytic Services: CASL Programmer’s Guide.

"computedVarsProgram":"string"

specifies an expression for each computed variable that you include in the computedVars parameter.

AliascompPgm
"importOptions":{"fileType":"ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters}

specifies the settings for reading a table from a data source.

Aliasimport_

For more information about specifying the importOptions parameter, see the common importOptions parameter.

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

specifies the relationship between tables. The keys are checked to make sure they are valid when you run the action. The format is "table1-column=table2-column". Specify this parameter for dimension tables (table1) only. It does not apply to fact tables (table2).

Aliasjoinkey
* "name":"table-name"

specifies the name for the view to create.

"prefixColumnNames":True | False

when set to False, the column names from the contributing table are used as-is. By default, the column names are prefixed with either tn_ or the value specified in the as parameter and an underscore. This behavior is applied only to the table that plays the role of the fact table.

DefaultTrue
"varList":["variable-name-1" <, "variable-name-2", ...>]

specifies the variables to use in the action.

"vars":[{casinvardesc-1} <, {casinvardesc-2}, ...>]

specifies the variables to use in the action.

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

"where":"where-expression"

specifies an expression for subsetting the input data.

Result Descriptions

caslib

The result is a string. You can access the value from results.caslib.

viewName

The result is a string. You can access the value from results.viewName.

view Action

Creates a view from files or tables.

Tip:The keys parameter must be specified if you use the action with more than one table.
Create a View with Two Tables
results <– cas.table.view(s,
caslib="string",
leftJoin=TRUE | FALSE,
required parameter name="string",
promote=TRUE | FALSE,
replace=TRUE | FALSE,
tables
=list( list(
as="string",
caslib="string",
computedVars
=list( list(
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
) <, list(...)>),
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),
keys=list("string-1" <, "string-2", ...>),
required parameter name="table-name",
prefixColumnNames=TRUE | FALSE,
varList=list("variable-name-1" <, "variable-name-2", ...>),
vars
=list( list(
format="string",
formattedLength=integer,
label="string",
required parameter name="variable-name",
nfd=integer,
nfl=integer
) <, list(...)>),
where="where-expression"
) <, list(...)>)
)
indicates a required parameter

Parameter Descriptions

caslib="string"

specifies the target caslib for the view.

AliastargetLib

leftJoin=TRUE | FALSE

when set to True, missing values are produced for columns in a dimension table that do not match the keys in the fact table. When False, the default, no result row is produced when a dimension table's keys do not match the fact table.

DefaultFALSE

* name="string"

specifies the name for the view to create.

promote=TRUE | FALSE

when set to True, the view is added with a global scope. This enables other sessions to access the table, subject to access controls. The target caslib must also have a global scope.

DefaultFALSE

replace=TRUE | FALSE

specifies whether to overwrite an existing view with the same name.

DefaultFALSE

tables=list( list(casview-1) <, list(casview-2), ...>)

specifies the input tables to use for the view.

Minimum items1

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

as="string"

specifies a table alias for the table. By default, this table alias and an underscore are used as a column name prefix for the columns contributed by this table. Use the prefixColumnNames parameter to disable the default behavior.

caslib="string"

specifies the caslib that is used by the input table.

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

specifies the names of the computed variables to create. Specify an expression for each variable in the computedVarsProgram parameter. If you do not specify this parameter, then all variables from computedVarsProgram are automatically included.

For more information about specifying the computedVars parameter, see Basic Syntax in SAS Cloud Analytic Services: CASL Programmer’s Guide.

computedVarsProgram="string"

specifies an expression for each computed variable that you include in the computedVars parameter.

AliascompPgm
importOptions=list(fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters)

specifies the settings for reading a table from a data source.

Aliasimport

For more information about specifying the importOptions parameter, see the common importOptions parameter.

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

specifies the relationship between tables. The keys are checked to make sure they are valid when you run the action. The format is "table1-column=table2-column". Specify this parameter for dimension tables (table1) only. It does not apply to fact tables (table2).

Aliasjoinkey
* name="table-name"

specifies the name for the view to create.

prefixColumnNames=TRUE | FALSE

when set to False, the column names from the contributing table are used as-is. By default, the column names are prefixed with either tn_ or the value specified in the as parameter and an underscore. This behavior is applied only to the table that plays the role of the fact table.

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

specifies the variables to use in the action.

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

specifies the variables to use in the action.

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

where="where-expression"

specifies an expression for subsetting the input data.

Result Descriptions

caslib

The result is a string. You can access the value from results.caslib.

viewName

The result is a string. You can access the value from results.viewName.

Last updated: November 18, 2025