DataSource
element in the common task
model. (You can also have a task with no DataSource
element.)
If you define the DataSource
element, a Velocity
variable is created to access the name of the specified data source.
The value of the variable is the same as the value of the name
attribute
for the DataSource
element.
Short Description
|
Determines whether the
specified value already exists as the name of a column in the data
source.
|
Parameter
|
input
the input string that
you want to check to see whether it exists.
|
Return Value
|
This method returns
a Boolean value that specifies whether the column already exists.
|
Example
|
<DataSource name="DATASOURCE"> <Roles> <Role name="analysisVariables" type="A" maxVars="0" minVars="0"> Analysis variables:</Role> <Roles> </DataSource> #if ($DATASOURCE.columnExists("MAKE")) ... #end /* If data set is Sashelp.Cars, the return value is true. */ |
Short Description
|
Returns the name of
the library for the data source.
|
Return Value
|
This method returns
a string that contains the name of the library for the data source.
|
Example
|
<DataSource name="DATASOURCE"> <Roles> <Role name="analysisVariables" type="A" maxVars="0" minVars="0"> Analysis variables:</Role> <Roles> </DataSource> $DATASOURCE.getLibrary() /* If data set is Sashelp.Cars, the return value is Sashelp. */ |
Short Description
|
Returns the number of
rows in the data source.
|
Return Value
|
If the data source is
available, a value of 0 or greater is returned. If this information
is not available, –1 is the return value. For example, in SAS
Studio when the selected data source is a data view, the row count
is not available, and the return code for this function is –1.
|
Example
|
<DataSource name="DATASOURCE"> <Roles> <Role name="analysisVariables" type="A" maxVars="0" minVars="0"> Analysis variables:</Role> <Roles> </DataSource> #if ($DATASOURCE.getRowsCount() > 0) ... #end /* If data set is Sashelp.Cars, the return value is 19. */ |
Short Description
|
Returns the table name
for the data source.
|
Return Value
|
This method returns
a string that contains the table name for the data source.
|
Example
|
<DataSource name="DATASOURCE"> <Roles> <Role name="analysisVariables" type="A" maxVars="0" minVars="0"> Analysis variables:</Role> <Roles> </DataSource> $DATASOURCE.getTable() /* If data set is Sashelp.Cars, the return value is Cars. */ |