Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8680919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:22:18+00:00 2026-06-12T21:22:18+00:00

My dataset is: ID AGE 1 65 1 66 1 67 1 68 1

  • 0

My dataset is:

ID     AGE

1      65
1      66
1      67
1      68
1      69
1      70
1      71
2      70
2      71
2      72
3      68
3      69
3      70

 [...]

My (basic) question is: which is the most direct way for obtaining a dataset with ID records starting with 65 <= AGE <= 68? (in the above example I would like to get the first 7 rows and the last three). Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:22:23+00:00Added an answer on June 12, 2026 at 9:22 pm
    data input_dataset;
    input ID     AGE;
    cards;
    1      65
    1      66
    1      67
    1      68
    1      69
    1      70
    1      71
    2      70
    2      71
    2      72
    ;
    run;
    
    proc sort data=input_dataset out=sorted;
    by ID;
    run;
    
    data work.first_age65to68;
      set sorted;
      retain keepit 0;
      by ID;
      if first.ID then do;
          if AGE ge 65 and AGE le 68 then keepit=1;
          else keepit=0;
      end;
      if keepit;
      drop keepit;
    run;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In DataSet.Tables[0].Columns[0] we have a DataType property. Now, I would like to iterate over
I have a dataset that looks like this year month age 2007 1 17
if i have a file containing say (age,weight,city,town,height) is there a way to restructure
I have made a basic program to add values to a dataSet and display
I'm running Glassfish web server with Strut2 and I would like to pull json
I would like to run an ANCOVA using car::Anova but cannot find out if
I need to create a set of unequal age groupings from a patient dataset
I have a dataset with a categorical variable hospital_code which has 10 levels. The
I would like to calculate distance between two groups. I am very confused. I
I created a binary classification tree using ctree. I would like each terminal node

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.