Help using Base SAS procedures

deleting rows

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 118
Accepted Solution

deleting rows

I want to delete the 44 first rows in sas database. I find how to delete a point (delete point ), but I want to delete all rows from 1 to 44.

Thanks


Accepted Solutions
Solution
‎09-03-2014 01:48 PM
Trusted Advisor
Posts: 1,129

Re: deleting rows

you can use firstobs option to control the observations you wish to keep in the dataset

data want;

  set have(firstobs=45);

run;

this will keep only observations starting from 45 to remaining and the first 44 obs will not be there in want;

Thanks,

Jag

Thanks,
Jag

View solution in original post


All Replies
Super User
Posts: 5,256

Re: deleting rows

If you don't have any particular meta data in the table (such as indexes, constraints etc) you could rewrite the table using data - set (firstobs=).

Data never sleeps
Solution
‎09-03-2014 01:48 PM
Trusted Advisor
Posts: 1,129

Re: deleting rows

you can use firstobs option to control the observations you wish to keep in the dataset

data want;

  set have(firstobs=45);

run;

this will keep only observations starting from 45 to remaining and the first 44 obs will not be there in want;

Thanks,

Jag

Thanks,
Jag
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 180 views
  • 0 likes
  • 3 in conversation