DATA Step, Macro, Functions and more

delete a line

Accepted Solution Solved
Reply
Contributor
Posts: 27
Accepted Solution

delete a line

 

Hello everyone,

 

I have a question, if you could help.

 

I am wondering about deleting the last line of my table.

 

Thank you for your help


Accepted Solutions
Solution
‎11-21-2017 09:58 AM
Super User
Posts: 9,923

Re: delete a line

[ Edited ]

And if you're in the mood for a little more typing,

data want;
set have nobs=nobs;
if _n_ ne nobs;
run;

Smiley Wink

 

Edit:

TBH, I'd rather use @draycut's solution.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code

View solution in original post


All Replies
PROC Star
Posts: 1,218

Re: delete a line

like this?

 

data want;
	set sashelp.class end=eof;
	if not eof;
run;
Solution
‎11-21-2017 09:58 AM
Super User
Posts: 9,923

Re: delete a line

[ Edited ]

And if you're in the mood for a little more typing,

data want;
set have nobs=nobs;
if _n_ ne nobs;
run;

Smiley Wink

 

Edit:

TBH, I'd rather use @draycut's solution.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 326 views
  • 6 likes
  • 3 in conversation