BookmarkSubscribeRSS Feed
Ted
Calcite | Level 5 Ted
Calcite | Level 5
I have created a dataset showing the datasets in a library, I was planning on using a parameter to read this data and then ask the user to choose a datset to use in a query.

I can see away of rewriting the query code to include a reference to the parameter but can find no way to perform this task within the query itself.
Am I missing something here or is this not presently possible in EG4?
2 REPLIES 2
ChrisHemedinger
Community Manager
Ted,

No, it's not possible to parameterize the selection of which input data set to use within a query -- except within a code node, as you mention.

Now, we could get creative with a potential workaround. Suppose you defined a code node like this:

data work.current / view=work.current;
set sashelp.&dataset;
run;

And associated it with the &dataset parameter in the project, which would show a list of valid datasets you wanted to expose.

Then you defined a query that built off of WORK.CURRENT, a view that points to whatever data set was selected in the previous step -- so you have a flow similar to the attached file.

The limitation is that the columns you select in the query would have to exist in any of the potential data sets you used as input. That is, if you assigned CURRENT.NAME to be in the result set, "NAME" would have to be present in any of the input data sets that you surfaced in the prompt.

Chris
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
Ted
Calcite | Level 5 Ted
Calcite | Level 5
Thanks Chris

That's exactly the way I did it in the end. Luckily all the variables in all the dsets are the same which allows this code to work. The user now has a nice pop up window to choose the datasets from. The only further problem I have found so far is that the drop down list window within tthe parameter window isn't wide enough to show the full dataset name. Is there a way of making it wider?

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
  • 2 replies
  • 731 views
  • 0 likes
  • 2 in conversation