06-30-2017 03:14 PM
Hi @HULK, a knowledgeable colleague passed along the following option fpr you to try:
You can’t achieve that in using a data process, but you could do so with a SAS process that uses either a SAS DS2, Groovy, or Jython process to make the SQL calls. You could use an IN operator in the query to match multiple values.
However, there are some considerations regarding statement pooling that have potential performance impact. You need a fixed number of parameters for the statement to be compiled and re-used. Otherwise, the statement gets prepared every single time it runs. If you know there are a maximum number of values, one way to work around that is to create a fixed length parameter string and populate it with values. So for example, if you have a maximum of ten values, the pre-prepared statement can have a placeholder for each:
SELECT Name, Age, Income FROM Customers where State IN (?,?,?,?,?,?,?,?,?,?)
Based on the values you need, If you have only 3 states in your IN clause, you can populate it this way:
(‘TX’,’MI’,’IL’ ,’IL’ ,’IL’ ,’IL’ ,’IL’ ,’IL’ ,’IL’ ,’IL’)