SAS Studio doesn't filter it:
I have this:
Add a WHERE statement that uses the SUBSTR *;
* function to include rows where the second letter *;
* of Basin is P (Pacific ocean storms).
data pacific;
set pg1.storm_summary;
drop Type Hem_EW Hem_NS MinPressure Lat Lon;
WHERE Substr(Basin, 2, 1) = "P";
run;
It shows all the values for the column when I run this code:
Regards,
GN
If this is literally what you did, end the last comment with a semicolon.
In general, you will find that a user error is *FAR* more likely than a major and central component of SAS not working.
Please show the log that results when you run the code.
Sorry, I don't have the code any longer.
But I think I was wrong and where clause worked properly.
Respectfully,
Guity
If this is literally what you did, end the last comment with a semicolon.
In general, you will find that a user error is *FAR* more likely than a major and central component of SAS not working.
BTW, if you are looking at just a single character, then you might want to know about the CHAR function, as in:
WHERE char(Basin,2) = "P";
It may not hurt to show the code you used to check on the result.
We get someone about once a week that "examines" the input data instead of the output data.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.