Role element,
the minVars and maxVars attributes
specify how many variables can be assigned to a specific role. Because
roles can have 1 to n number
of variables, the corresponding Velocity variable is an array. The
syntax for an array is $variable-name[index-number].
In this example, $subsetRole is the Velocity variable for the Subset
by role (which is defined in the metadata):proc rank data=$dataset (where=($subsetRole[0]="$filterValue"))descending
|
Attribute
|
Description
|
|---|---|
format |
specifies the SAS format
that is assigned to the variable.
|
informat |
specifies the SAS informat
that is assigned to the variable.
|
length |
specifies the length
that is assigned to the variable.
|
type |
specifies the type of
variable. Valid values are
Numeric or Char.
|
value |
specifies the name of
the variable.
|
<DataSources>
<DataSource name="DATASOURCE">
<Roles>
<Role type="A" maxVars="0" order="true" minVars="0"
name="VAR">Columns</Role>
<Role type="A" maxVars="0" order="true" minVars="0"
name="BY">Analysis group</Role>
<Role type="N" maxVars="0" order="true" minVars="0"
name="SUM">Total of</Role>
<Role type="A" maxVars="0" order="true" minVars="0"
name="ID">Identifying label</Role>
</Roles>
</DataSource>
</DataSources>
<CodeTemplate>
<![CDATA[
#if( $BY.size() > 0 )/* Sort $DATASOURCE for BY group processing. */
PROC SORT DATA=$DATASOURCE OUT=WORK.SORTTEMP;
BY #foreach($item in $BY ) #if($item.get('type') == 'Numeric' $item #end#end;
#end
RUN;]]>
</CodeTemplate>