I trying to create custom task in SAS Studio. I faced with problem, that i can't use variables of <DataSource>
or <Option>
in XML attributes or in tagged texts.
I need to programm task, that creates a new dataset in predefined library. Name of the dataset may be the same or custom. Here is an example of code:
<?xml version="1.0" encoding="utf-8"?>
<Task schemaVersion="5.0" runNLS="never">
<Registration>
<Name>Sample Task</Name>
<Description>Demonstrates the Common Task Model functionality.</Description>
<GUID>C6AC34BD-D14A-4CF5-BF2F-A110711BF819</GUID>
<Procedures>PRINT</Procedures>
<Version>3.5</Version>
<Links>
<Link href="http://www.sas.com">SAS Home page</Link>
</Links>
</Registration>
<Metadata>
<DataSources>
<DataSource name="DATASOURCE">
</DataSource>
</DataSources>
<Options>
<Option name="DATATAB" inputType="string">DATA</Option>
<Option name="DATAGROUP" inputType="string">DATA</Option>
<Option name="ROLESGROUP" inputType="string">ROLES</Option>
<Option name="OPTIONSTAB" inputType="string">OPTIONS</Option>
<Option name="GROUP" inputType="string">GROUPS</Option>
<Option name="labelRADIO" inputType="string">Choose name</Option>
<Option name="nameRadioDefault" variable="radioNameChoice" defaultValue="1"
inputType="radio">$DATASOURCE.getTable()</Option>
<Option name="nameRadioAlter" variable="radioNameChoice"
inputType="radio">Enter alter name:</Option>
<Option name="textTableName" defaultValue="" inputType="inputtext"
required="true"
indent="1"
promptMessage="Enter new table name"
missingMessage="Missing text."></Option>
</Options>
</Metadata>
<UI>
<Container option="DATATAB">
<DataItem data="DATASOURCE"/>
<OptionItem option="labelRADIO"/>
<OptionItem option="nameRadioDefault"/>
<OptionItem option="nameRadioAlter"/>
<OptionItem option="textTableName"/>
</Container>
</UI>
<Dependencies>
<Dependency condition="$radioNameChoice == 'nameRadioDefault'">
<Target action="disable" conditionResult="true" option="textTableName"/>
</Dependency>
<Dependency condition="$radioNameChoice == 'nameRadioAlter'">
<Target action="enable" conditionResult="true" option="textTableName"/>
</Dependency>
</Dependencies>
<CodeTemplate>
<![CDATA[
%put DATASET=$DATASOURCE;
%put SASLIBRARY=$DATASOURCE.getLibrary();
%put SASTABLE=$DATASOURCE.getTable();
]]>
</CodeTemplate>
</Task>
As result, I have this simple custom task:
In code area, I see reaction by changing options:
Choose another:
But unfortunately, name of radiobutton don't changing. I tried to wrap VTL variable $DATASOURCE.getTable()
by <![CDATA[...]]>
, but it's not working.
In SAS Studio 3.5: Developer's Guide to Writing Custom Tasks
So my question is it possible to use VTL variables in that way? And if possible, how to realize it?
In SAS Studio 3.5: Developer's Guide to Writing Custom Tasks I can't find answer, but SAS Studio has a complex task as "Join", that has graphical Data Source. And it's not described in Guide. This led to the idea - not all capabilities describe in Guide. If I wrong, please correct Me. Thanks.
Thanks.