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

Hi,

 

I have created a prompt using the SAS stored process under EG 7.1 - please see the attached prompt window. However, even when i select the Gender = 'M', the report generated from the stored process shows all the records including Gender = 'F'. Can someone see whats going on here.

 

Please advise.

 

 

SAS_prompt.PNG

 


SAS_prompt.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
Vince_SAS
Rhodochrosite | Level 12

How is your SAS code using the MULTISELECT_GENDER macro variable?  This code should work for the simple case that you show:

 

proc print data=sashelp.class;
  where (sex eq "&MULTISELECT_GENDER");
run; quit;

 

Vince DelGobbo

SAS R&D

View solution in original post

7 REPLIES 7
TomKari
Onyx | Level 15

Very likely you haven't modified that task that uses the filter to exploit it properly. Take a look at that, and try to figure out what you need to do to use the value of your prompt selection...it will be a macro variable.

 

Tom

srihari1
Calcite | Level 5

Thanks Tom.

 

Am looking at the LOG from the Stored process and the macro variable seem to resolve fine - user selects the "M" for Gender. Following is the partial paste from log. Not sure why the report from the Stored process also includes Gender = 'F' along with 'M'.

 

>>> SAS Macro Variables:

MULTISELECT_GENDER=M

MULTISELECT_GENDER_COUNT=1

 

TomKari
Onyx | Level 15

Unfortunately, I don't currently have access to an SP environment, so I can't provide a recipe to follow. Someone else will have to pick it up from here.

 

srihari1
Calcite | Level 5
Tom, Appreciate for your time.
Vince_SAS
Rhodochrosite | Level 12

How is your SAS code using the MULTISELECT_GENDER macro variable?  This code should work for the simple case that you show:

 

proc print data=sashelp.class;
  where (sex eq "&MULTISELECT_GENDER");
run; quit;

 

Vince DelGobbo

SAS R&D

srihari1
Calcite | Level 5
Thanks Vince; Now my code works the way it supposed to be.
srihari1
Calcite | Level 5
Sorry, missed your question. The MULTISELECT_GENDER is created via the prompt from the Stored Process and then i run your proc print code to make the report work.

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
  • 7 replies
  • 925 views
  • 0 likes
  • 3 in conversation