BookmarkSubscribeRSS Feed
Tom
Super User Tom
Super User

I was trying to build a Task using SAS/Studio that allows a user to make a select from a list of values pulled from a variable in a SAS table.  The SAMPLE task has a DISTINCT option that works that way, but it is setup for the user to first select the dataset and the variable.  For this application I want to just hard code the dataset and varaible name into the task definition. Only user input will be to pick a value from the list.

 

So in the Sample Task they have defined this distinctEXAMPLE option that references the option named VAR.

<Option name="distinctEXAMPLE" inputType="distinct" source="VAR">Distinct Values:</Option>

And the VAR option is defined earlier in the Data Sources section as:

<DataSources>
  <DataSource name="DATASOURCE">
    <Roles>
      <Role type="A" maxVars="1" order="true" minVars="1" name="VAR">Required variable:</Role>
      <Role type="N" maxVars="0" order="true" minVars="0" name="OPTNVAR" exclude="VAR">Numeric variable:</Role>
      <Role type="C" maxVars="3" order="true" minVars="0" name="OPTCVAR">Character variable:</Role>
    </Roles>
  </DataSource>
</DataSources>

So how would I modify this so that "distinctEXAMPLE" will get the list of disctinct values of the variable named "DATABASE" in the dataset named  "MYMETA.SOURCEDB" without the user needing to first select that dataset and variable name?

1 REPLY 1
grace_sas
SAS Employee

Hi Tom,

 

You cannot currently hardcode a datasource and role in the metadata or UI elements.  So there is no way to reference the variable to use a distinct control (or any other control).  This ability is being evaluated for a future release.

 

Best,

Grace

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1094 views
  • 0 likes
  • 2 in conversation