BookmarkSubscribeRSS Feed
HULK
Obsidian | Level 7

Hi!

 

I have a question about RTDM.

How can I insert some multiple values in VALUE field in a Read-data process node? It is possible? Screenshot in attach. 


read-data process.PNG
1 REPLY 1
BeverlyBrown
Community Manager

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’)

Register now for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

How to improve email deliverability

SAS' Peter Ansbacher shows you how to use the dashboard in SAS Customer Intelligence 360 for better results.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1378 views
  • 0 likes
  • 2 in conversation