Hi everyone,
I am new in SAS and I am currently working on my first assignment.
I have a PISA data set, where I have to find all the schools that have a reading score above 500.
Now, I do have a variable for school 'schoolid' and a variable for reading score 'score_r'.
I thought about making an if-statement that returns the value in schoolid, whenever they fulfilled score_r>500, but do you know how I can write this in SAS the proper way?
best regards
Sulaiman.
if score_r>500 then ... ;
It's not really clear to me what you want to have happen when score_r>500, so that part requires more explanation. The value of school_id is already in the variable school_id, so you don't really need to do anything, or maybe I'm just not understanding what you are asking.
In this task I need to make a code that only returns school1, because that is the only one with score_r>500
So you want to eliminate the school with score_r<=500 from the data set?
data want;
set have;
if score_r>500;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.