10-30-2014 02:29 PM
When utilizing user prompts within a SAS EG Query Builder, how do you apply a SAS function such as taking the value that the user inputs and converting it to upper case prior to performing the filter operation?
I'm guessing I might need to take the user prompt out of Query Build and insert it into a user program in order to convert the user input to upper case and then feed that to the Query Builder step. I'm hoping someone has a good example and suggestion about how to accomplish this.
10-31-2014 08:26 AM
User prompts generate macro variables. The macro variable will then be used as "&name". Put upcase() around that: upcase("&name"). You will have to use the advanced filter option of the query builder.
10-31-2014 01:29 PM
I forgot to include a few important details about the type of prompt that I'm using which may complicate using the advanced filter option part of the Query Builder.
I'm using a prompt type that allows for multiple values to be entered. Then I'm currently using that prompt in a basic filter where the operator is set to "In a list". As far as I can tell, the basic filter doesn't allow for specifying a SAS function, such as upcase. So, is there a way to use the advanced filter that you're suggesting with a prompt type that allows for multiple values and accomplish the same filter operation as the "In a list" operator in conjunction with the upcase function?
10-31-2014 04:42 PM
It are still SAS macro vars altough they are in list. there is naming standard structure for that. Lokk what is done with those macro-vars.
11-03-2014 02:02 AM
The prompt defines macro variables. These are used in the Query Builder. Use the advanced option (where you can enter conditions manually) to enter the upcase function. In case you get a condition like "variable in (&list)", you can use %upcase(&list).
Or take the code generated by the Query Builder, put it into a separate Code Object and edit there.
Advanced SAS usage needs SAS programming, anyway. So use the code generated by the wizards in EG as a starting point.