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;

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!

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