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.

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1432 views
  • 0 likes
  • 2 in conversation