As I stated previously, you can use IF LAST. THEN OUTPUT; with a sorted file using a BY statement and being the last variable in the BY. From your explanation, I believe the BY variables are ID, DATE (suggest inputting as a SAS NUMERIC date, not character), SERVICE and TYPE. Use EQUALS on the SORT to ensure the incoming order is maintained for your AMT values.
Again, see the recommended SAS support site DOC references for details, and also the EQUALS parameter discussion for PROC SORT.
Scott Barry
SBBWorks, Inc.
... View more