Oh ok thanks for answer,
I am used to put some commas. But even, when I try your method i get an error.
The first query works well. I get the result: 1 5 13
But after when I run the second query so I have:
WHERE mydata IN (1 5 13)
And I get the error:
ERROR: Expression using IN has components that are of different data types.
because mydata is character.
If your data is character you need the quotes.
@Planck wrote:
Oh ok thanks for answer,
I am used to put some commas. But even, when I try your method i get an error.
The first query works well. I get the result: 1 5 13
But after when I run the second query so I have:
WHERE mydata IN (1 5 13)And I get the error:
ERROR: Expression using IN has components that are of different data types.because mydata is character.
The error message explains the problem. You cannot use numeric literals in the IN list if the variable being compared is character. You need to use character literals.
WHERE mydata IN ("1" "5" "13")
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.