Desktop productivity for business analysts and programmers

Parameters In Queries

Occasional Contributor Ted
Occasional Contributor
Posts: 16

Parameters In Queries

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?
Community Manager
Posts: 2,692

Re: Parameters In Queries


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;

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.

Occasional Contributor Ted
Occasional Contributor
Posts: 16

Re: Parameters In Queries

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?
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation