Search code examples
saspromptenterprise-guide

How to use multiple text values using sas prompt


I am trying to create a prompt which allows to user to enter multiple values from a list. I have used Prompt Type as Text.
Method of populating the prompt : User select values from static list
Number of values : Multiple Values prompt

I have kept the name of my prompt as Products. Basically I want to have a macro which has values such as "product 1","product 2", Product 3", "product 4" separated by commas.

Comma separated list

When I try and resolve the products macro no matter how many products I select in the prompt it always resolves the first product. Here it is always resolving only Loan as the resolution to the products macro. I want all the products in that I select through prompt to come in the macro product. Example ("loan","Overdraft","RCF") Please suggest what to do in this case


Solution

  • I made a prompt, "Color", with the six colors of the rainbow, with the settings like you describe (and "use throughout project").

    Then I attached it to the following program:

    %put _global_;
    

    And what I see is this;

    8          %LET Color0 = 4;
    9          %LET Color2 = Red;
    10         %LET Color3 = Yellow;
    11         %LET Color4 = Orange;
    12         %LET Color1 = Blue;
    13         %LET Color_count = 4;
    14         %LET Color = Blue;
    

    This is how multiple value prompts work: they put the first selection in &prompt, then put the number of selected items in &prompt0, and then put the selected items in &prompt1-&&prompt&prompt0. You can then use them in a number of ways. You can

    %do i = 1 %to &color0.;
      %put &&color&i.;
    %end;
    

    For example.