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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

First and Last Transaction in Sas by Date

Status
Not open for further replies.

sap1958

Technical User
Oct 22, 2009
138
0
0
US
proc sql;
create table Expenses1 as
select FlightID,Date,Expenses
from Expenses;
quit;

The Date is in datetime format (ie 02DEC1999). Here is sample output
FlightID Date Expenses
0101 02DEC1999 55
0101 14DEC1999 125 want to see
0102 26DEC1999 155 want to see
0102 09DEC1999 25

In this example I want to see the last transaction by date only (ie the last transaction for FlightID 0101 and 0102 I read about using .First and .Last but need assistance in how to use the first and last transaction to show data
 
I think I figured it out using a proc sort data statement
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top