BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GN0001
Barite | Level 11

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

Blue Blue
1 ACCEPTED SOLUTION

Accepted Solutions
WarrenKuhfeld
Ammonite | Level 13

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.

View solution in original post

6 REPLIES 6
PGStats
Opal | Level 21

Please show the log that results when you run the code.

PG
GN0001
Barite | Level 11

Sorry, I don't have the code any longer.

But I think I was wrong and where clause worked properly.

Respectfully,

Guity

Blue Blue
WarrenKuhfeld
Ammonite | Level 13

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.

mkeintz
PROC Star

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";
--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
ballardw
Super User

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.

Cynthia_sas
SAS Super FREQ
Hi:
This looks like a program from our Programming 1 class. We have a separate forum for the Programming 1 and Programming 2 classes, so student questions are monitored by the class instructors. In the future, you might want to consider posting class questions there. We need to know generally, what lesson you're working on and the title of the activity or practice you're working on. If you open a specific program file as a starter, that is useful to know too.
Cynthia
Here's the link for future reference to the forum for these classes: https://communities.sas.com/t5/Programming-1-and-2/bd-p/course_discussions

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 6 replies
  • 2433 views
  • 7 likes
  • 6 in conversation