02-20-2015 12:54 PM
I am attempting to create a multiple value text prompt with user input values.
My code so far is:
proc report data=FS_STG.STG_PROMOTION nowd;
column PROD_ID PROMO_EFF_DATE cv1 PROMO_END_DATE cv2 VEHICLE_NM PROMO_NAME FOCUS_PAGE PROMO_PRICE, MEAN=PROMO_PRICE_MEAN RETAIL_PRICE, MEAN=RETAIL_PRICE_MEAN PROMO_NO, MODE=PROMO_NO_MODE;
WHERE PROD_ID = "&prod_id" ;
define PROD_ID / group 'PROD_ID' missing;
if PROD_ID ne ' ' then hold1=PROD_ID;
if PROD_ID eq ' ' then PROD_ID=hold1;
The log displays:
%LET PROD_ID1 = 5550123;
%LET PROD_ID0 = 2;
%LET PROD_ID_count = 2;
%LET PROD_ID2 = 1100255;
%LET PROD_ID = 5550123;
With my current code the results only display PROD_ID 5550123. What do I need to change to have it also recognize PROD_ID2, etc (for the number of values the user inputs)?
02-22-2015 11:13 AM
You will at least have to change your WHERE statement to something like:
WHERE PROD_ID in ("&PROD_ID1" "&PROD_ID2" "&PROD_ID3" "&PROD_ID4");
But depending on how you want your program to operate, you may have to "macro-ize" your code with a %DO loop to build the exact WHERE statement by looping from 1 to &PROD_ID_count and using macro techniques in a macro program. &PROD_ID will always show the first selection that is made in a multi-value selection prompt, so if you need the other values, it is up to you to use the numbered macro variables that are sent by the prompting interface.
02-23-2015 12:39 PM
Q1983: The Communities Admin posted the following a week or so ago:
Your discussions will not go through moderation. However, we are fine tuning our spam filter and post-rate timing to help curb this recent abuse. If you experience any issues with the post-rate change (prevents multiple messages from being posted in a certain time frame - such as within 60 seconds) ... let me know