BookmarkSubscribeRSS Feed
acw
Calcite | Level 5 acw
Calcite | Level 5
Hi

How can I make a computed column use the result of a parameter in an eguide Filter and Query.

Say I have a parameter called thing.

How do I structure the expression text so that it can use the parameter. I've tried &thing, "&thing" and various other combinations, but I can't get it to request the parameter to fill before actioning. Error along the lines of symbolic reference not resolved.

Peversely system parameters seem to resolve properly. So an Expression Text of "&_clientuserid" will resolve to the user id.

thanks
acw
6 REPLIES 6
DerekAdams
Calcite | Level 5
The parameter has to be given a value before you can use it.

You can use the parameter manager, (under the tools menu), and to create it. There are options as to how it gets a value, by prompting, etc. Then right click on the filter query task select properties / parameters and add the parameter to the query. It should then get resolved.

Search the EG help for creating parameters or even this forum
acw
Calcite | Level 5 acw
Calcite | Level 5
Derek

thanks, but 'fraid that just doesn't work.

I create the parameter, name: thing, type: string, default value: aaa, prompt for value selected, allow macro substitution selected, (even tried enclose values within quotes).

Then created a filter and query, with expression text of &thing, and left it with the default name of Calculation1.

The moment I close down the construction of the calculated item, it causes the error. Log is:

WARNING: Apparent symbolic reference THING not resolved.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, BTRIM, INPUT, LOWER, PUT, SUBSTRING, UPPER, USER.


However, if I use the system item &_clientuserid, I can get it to populate properly by putting "&_clientuserid" into the text of the computed column. If I use "&thing", it will run, but returns &thing rather than resolving for parameter input.

acw
DerekAdams
Calcite | Level 5
It will do. You have to pass a value to the parameter for it to work. If you use the parameter manager you can specify a default value or ask it to prompt you.

Have a look at the help, it covers how to do this
RichardH_sas
SAS Employee
ACW: Did you register the parameter with the Filter and Query task? Right-click the task, select properties, and the third choice down in the selection pane should be called "prompt" (EG 4.2) or "parameter" (EG 4.1). You need to add the parameter to the task in order for things to work. Sneaky, isn't it? In EG 4.2, you can also add a prompt directly in the Query Builder interface under Options \ Options for this query.

This is also a handy tactic when you have prompts in a piece of SAS code.
acw
Calcite | Level 5 acw
Calcite | Level 5
RichardH

Thank you, thank you, thank you. That was the missing trick.

Included the parameter in that way, and things resolved properly.

Also tried the code option. Hadn't even thought about doing that at this stage.

acw
bananadragon
Calcite | Level 5

I believe that’s what Derek was trying to elaborate as well as the last poster. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 6 replies
  • 4376 views
  • 1 like
  • 4 in conversation