Search the site...

SASCRUNCH TRAINING
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
Sentry Page Protection
Please Wait...
Exercise (2-2)

The program code below is intended to:
  • Create a new variable called GROUP based on the following logic:
    • Group = "Above Average" for male students above 64 inches and female students above 60 inches
    • Group = "Below Average" for other students
  • Assign the length of Group to be 30
  • Keep only the NAME, SEX, HEIGHT and GROUP columns in the output data set.
data class (keep name sex height group);
set sashelp.class;
if sex = "M" and height > 64 then Group="Above Average";
if sex = "F" and height > 60 then Group="Above Average";
else Group="Below Average";

length group 30;

run;

Correct the program and calculate how many students are in each group.

Next
Already a member? Go to member's area.