BookmarkSubscribeRSS Feed
AndersBergquist
Quartz | Level 8
I try to do a SP for the result of a questioner.
I have some background informations, variable b1 - b5 and the answers q1-q10,
I want to do one prompt there the user can choice the background information's and after that, one prompt there they can choice q1-q10.

I try to use "Data source item" but I can not filter it. I am using EG 4.2. Also, I working with infomaps which also makes problems?

Does someone have a solution? I think it is a common problem.

Message was edited by: Berga Message was edited by: Berga
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Look at the example of prompting the user for a REGION value in order to run a SP for a specific region...in this paper:
http://www2.sas.com/proceedings/forum2008/024-2008.pdf

The macro variable &REG is used to hold the selection that the user made from the stored process prompting interface. Even though there is only one parameter in the stored process example in this paper, a definition for a second parameter is easy to do. This paper shows the use of &REG in a WHERE statement for row selection purposes. However, you could just as easily have used a selection in a VAR statement or a COLUMN statement or a TABLE statement to control the columns that appear on a report.

The best recommendation I know of is to start with a working program (one that is NOT a stored process) that does what you want to do and then gradually use SAS macro variables to take the place of pieces of code (where you will subsitute the user's choices for code portions). Then once you have the revised code working with your "hard-coded" macro variables, you are ready to turn this program into a stored process and to register the stored process and parameters in the metadata.

When a user is prompted to supply information to a stored process, the prompting interface creates global macro variables which are passed to either the Stored Process Server or the Workspace Server for use when the SP is executed on the server.

To understand more about SAS macro processing and macro variables, this paper provides a good introduction:
http://www2.sas.com/proceedings/sugi28/056-28.pdf

cynthia

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 977 views
  • 0 likes
  • 2 in conversation