BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
krusader
Fluorite | Level 6

How does "all possible values" work to set the value of the prompt macro variable? I am using prompt values entered by the user to decide an employee ID for example. Does all possible values essentially just remove the filter or does it set some special value that a PROC SQL filter recognizes?

 

In the macro variable output in the log I see that _ALL_VALUES_ is set as a value. How does SAS interpret this? I am not getting errors but I am also not getting results in my SQL that looks something like this:

 

Select * From EMPLOYEE

Where EMP_ID = "&employeeid"

 

-- I select all possible values but I get no result set and no errors

 

Any help on how to successfully use All Possible Values? I'm creating my stored process in SAS Enterprise Guide 7.11

1 ACCEPTED SOLUTION

Accepted Solutions
Jatin_Jim
Obsidian | Level 7

Hello Krusader.

 

You can certainly use the below code to get the All Possible values in your output..

 

In my Case I have created Propmt for State Name so you can make the changes accordingly.

( I will have option to select more the one state or can select _ALL_VALUES_ )

 

PROC SQL;
   CREATE TABLE WORK.QUERY_FOR_STATEVIEW AS
   SELECT DISTINCT t1.STATE
      FROM SASORCL.SAS_BI_VW_SALESVIEW t1
      WHERE %_eg_WhereParam( t1.STATE, state, IN, TYPE=S, IS_EXPLICIT=0 );
QUIT;

 

 

Note:  Make sure you are using where clause for "In A List" operator not "=" operator..

 

 

Let me know if you need anymore infor for the same.

 

 

Regards;

Jim

 

View solution in original post

1 REPLY 1
Jatin_Jim
Obsidian | Level 7

Hello Krusader.

 

You can certainly use the below code to get the All Possible values in your output..

 

In my Case I have created Propmt for State Name so you can make the changes accordingly.

( I will have option to select more the one state or can select _ALL_VALUES_ )

 

PROC SQL;
   CREATE TABLE WORK.QUERY_FOR_STATEVIEW AS
   SELECT DISTINCT t1.STATE
      FROM SASORCL.SAS_BI_VW_SALESVIEW t1
      WHERE %_eg_WhereParam( t1.STATE, state, IN, TYPE=S, IS_EXPLICIT=0 );
QUIT;

 

 

Note:  Make sure you are using where clause for "In A List" operator not "=" operator..

 

 

Let me know if you need anymore infor for the same.

 

 

Regards;

Jim

 

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1851 views
  • 1 like
  • 2 in conversation