Updating stored process prompts in EG 7.1
See attached.
Prompt SBU is a static list and includes the option of "ALL"
Market is dynamic drop down lists built from an external file and is dependent on SBU.
File building MARKET does not contain option for ALL.
I want to be able to only pick SBU while leaving MARKET blank and then interpret this as MARKET = ALL in the program.
I'm able to do this by allowing blank as a choice. Then when parm passes to program it shows on the log as MARKET=; and resolves to MARKET=''.
I've tried various methods to "read" what is in MARKET parm...is it blank? null? Missing? but nothing works...there must be a way to determine what is contained in MARKET in order to re-set it to ALL...
any thoughts are appreciated.
Thank you!
test shows parm is null...
I think I solved it by doing this.
%MACRO TEST;
%if &market > '' %then %let market = &market;
%else %let market=ALL;
%MEND;
Thank you!
test shows parm is null...
I think I solved it by doing this.
%MACRO TEST;
%if &market > '' %then %let market = &market;
%else %let market=ALL;
%MEND;
Testing for null macro vars is suprisingly tricky.
&market > '' will actually compare the value of &market to the value of two quote marks. The macro language does not use quotation marks in the same way as the data step language. In the macro language, quot marks are part of the value, just like any other text.
Chung & King have a nice paper on how to test for blank parameters.
http://changchung.com/download/022-2009.pdf
Their approach would suggest you use something like:
%MACRO TEST;
%if %sysevalf(%superq(market)=,boolean) %then %let market = ALL;
%MEND;
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.
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.