BookmarkSubscribeRSS Feed
sasuser86
Calcite | Level 5
Hi
Please help on the below query for one of my investigation.

Data: student indicator1 indicator2
A 0 N
A 0 Y
A 1 N
A 1 Y
B 0 N
B 0 N
C 1 N
C 0 Y

I want to segregate the unique rows of students who have indicator 1 as
NOT 0 or indicator 2 as NOT N in my output. Please help to guide.



2 REPLIES 2
Amir
PROC Star

Hi,

 

This looks a bit like homework. What have you tried so far? Share any code you have tried and show the log with any error messages.

 

If you haven't tried anything yet then try looking at the if statement documentation, which includes examples:

 

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202239.htm

 

then you can post back your findings.

 

What you have said could almost be put into SAS:

 

if indicator1 ne 0 or indicator2 ne 'N'

 

Edit: For the "unique" requirement, you could test for "first.variable" and "last.variable".

 

 

Regards,

Amir.

novinosrin
Tourmaline | Level 20

what do you mean by

who have indicator 1 as
NOT 0 or indicator 2 as NOT N in my output.

 

Can you post the output for your input sample plz

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 972 views
  • 1 like
  • 3 in conversation