BookmarkSubscribeRSS Feed
Omodara
Calcite | Level 5

Please I have this set of data I want to delete rows 1-3, 5-6 and row 60

Which SAS code can I use?

 

5 REPLIES 5
Astounding
PROC Star

An easy way:

 

data want;

set have;

if _n_ in (1, 2, 3, 5, 6, 60) then delete;

run;

Omodara
Calcite | Level 5
I have tried it its showing empty table I suppose I should include the name of the data set some where. Let say tank id the original dataset name
Omodara
Calcite | Level 5
lets say the name of the initial data set is "tank" where how will I enter the code
Astounding
PROC Star

You mean this?

 

 

data want;

set tank;

if _n_ in (1, 2, 3, 5, 6, 60) then delete;

run;

 

But you will need to learn some basics.  To be used in a SET statement, TANK has to be a SAS data set.  So you need to learn how to get from a spreadsheet to a SAS data set.

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2269 views
  • 0 likes
  • 2 in conversation