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

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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