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

Hi,

I am trying to do this question in code, the question is:

Write observations to two new data sets (high_scores and low_scores) depending on the value of high_score (1 - high scores, 0 - low scores). Exclude the variable high_score? 

The dataset is called WORK.LASVEGAS. Any help with this will be much help. 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Data work.high_scores (drop=high_score) work.low_scores (drop=high_score);

    set work.lasvegas;

   if high_score= 1 then output work.high_scores;

   else if high_score=0 then output work.low_scores;

run;

View solution in original post

2 REPLIES 2
Reeza
Super User

What do you have so far? Happy to help with homework, not so much to just provide an answer.

 


@Goffy123 wrote:

Hi,

I am trying to do this question in code, the question is:

Write observations to two new data sets (high_scores and low_scores) depending on the value of high_score (1 - high scores, 0 - low scores). Exclude the variable high_score? 

The dataset is called WORK.LASVEGAS. Any help with this will be much help. 


 

ballardw
Super User

Data work.high_scores (drop=high_score) work.low_scores (drop=high_score);

    set work.lasvegas;

   if high_score= 1 then output work.high_scores;

   else if high_score=0 then output work.low_scores;

run;

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
  • 957 views
  • 0 likes
  • 3 in conversation