Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get only the last row

Status
Not open for further replies.

timppap

Technical User
Feb 10, 2006
7
0
0
SE
How I can get only the last from A and B or several more ?

Name Dateperiod
A 200301
A 200901
A 201001
B 200801
B 200901
B 201001


I want only
A 201001
B 201001

Thanks!
 
Try using last.

Code:
data have ;
   input name :$1. dateperiod :$6. ;
cards ;
A    200301
A    200901
A    201001
B    200801
B    200901
B    201001
;;;;;

data want ;
   set have ;
   by name notsorted ;
   if last.name ;
   run; 
proc print;run;
 
try to use @ Column option to read 201001 or # to read the observation wise
 
Hi ! Would You give an examble so I understand !

Thanks !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top