Hi:
I'm confused. At one point, if I remember correctly, you had designed a stored process that allowed the users to select MULTIPLE choices for a stored process parameter. So in that case, you would already have numbered parameters (&CHOICE1, &CHOICE2, &CHOICE3) that will have come back to your program from the server.
Have you designed a different stored process in which you allow the users to type in a text string? And now you want to break apart the "big" text string (which may contain commas or spaces), only to join the separate pieces back together again for a where clause? And the resulting where clause will be a macro variable?
Here are some previous forum posts that are still relevant:
http://support.sas.com/forums/thread.jspa?messageID=3088ఐ
http://support.sas.com/forums/thread.jspa?messageID=6195ᠳ
http://support.sas.com/forums/thread.jspa?messageID=6259ᡳ
And one thought...if you see the string "unquote" in your parsed macro variables, that may because you used UNQUOTE instead of the
%UNQUOTE function. I'm pretty sure that you don't want to "unprotect" the text string with the %UNQUOTE function...unless you know it's been protected with a different quoting function.
Once you move out of the world of multiple choices for input parameters (where the creation of the serially numbered parameters is managed by the stored process server) and into the world of parsing macro variables, which may contain "unsafe" characters (unsafe syntactically...because somebody could enter a comma or a single quote or a semi-colon that would "mess" up your SAS code in the compiler). Then you get into the world of Macro Facility QUOTING functions.
I like to think of these QUOTING functions as "masking" or "protection" functions because they mask the normal meaning of certain punctuation or words and prevent them from being mis-interpreted as part of a SAS program. For example, you might have the value "OR" meaning Oregon -- but in some instances, you need to protect the "OR" from being treated as a logical operator. Or, the text string "Sales > 500", you may need to protect the > from being treated as part of an HTML tag. Or the list "ABC, DEF" -- COULD look like an invalid argument to a function. Etc, etc.
A full discussion of MACRO quoting functions is way beyond the scope of what can be addressed in the forum. There is a whole section in the Macro documentation on Macro Quoting functions:
How Macro Quoting Works
Other Functions That Perform Macro Quoting
Introduction to Macro Quoting
Deciding How Much Text to Mask with a Macro Quoting Function
Deciding When to Use a Macro Quoting Function and Which Function to Use
Referring to Already Quoted Variables
You may need to "step up" your quoting protection by either using a different macro quoting function or by changing to the use of %SCAN or
%QSCAN functions (instead of %SYSFUNC and "regular" SCAN). This is complicated by the fact that in some instances, when you allow the users to type in a text string (as for an input parameter) -- that string may already be "protected" at the server before you get it and you may have to "unprotect" it in your stored process code by using the STPSRV_UNQUOTE2 function. (a stored process specific quoting function).
At this point, because you have quite a lengthy bunch of code and because more information is needed to help you debug the problem (how is the input parameter defined, what are the possible values, how is your program dealing with the input parameters, and what you want to do, ultimately, with your input parameters), your best bet for a quick resolution is to contact Tech Support.
cynthia