Hi
I would like to have some inputs on how to solve this in an easy way; I have made a solution but I think there could be better ways of doing it;
I have data;
data test;
input Contractnbr $13. date :date9. month :yymmn6. Amount;
format date date9.;
format month yymmn6.;
datalines;
63000-1000538 09SEP2011 201110 23.00
63000-1000538 09SEP2011 201110 300.00
63000-1000538 12SEP2011 201110 -200.00
63000-1000538 16SEP2011 201110 22.00
63000-1000538 16SEP2011 201110 200.00
63000-1000538 19SEP2011 201110 -300.00
63000-1000538 20SEP2011 201110 45.00
63000-1000538 20SEP2011 201110 753.50
63000-1000538 20SEP2011 201110 1337.00
63000-1000538 20SEP2011 201110 2605.00
63000-1000538 26SEP2011 201110 22.00
63000-1000538 26SEP2011 201110 200.00
63000-1000538 29SEP2011 201110 70.00
63000-1000538 29SEP2011 201110 5000.00
63000-1000538 01OCT2011 201111 25.00
63000-1000538 01OCT2011 201111 38.80
63000-1000538 01OCT2011 201111 500.00
63000-1000538 02OCT2011 201111 30.00
63000-1000538 02OCT2011 201111 1000.00
63000-1000538 06OCT2011 201111 25.00
63000-1000538 06OCT2011 201111 500.00
63000-1000538 07OCT2011 201111 22.00
63000-1000538 07OCT2011 201111 200.00
63000-1000538 08OCT2011 201111 25.00
63000-1000538 08OCT2011 201111 500.00
63000-1000538 09OCT2011 201111 30.00
63000-1000538 09OCT2011 201111 1000.00
63000-1000538 10OCT2011 201111 30.00
63000-1000538 10OCT2011 201111 1000.00
63000-1000538 11OCT2011 201111 26.00
63000-1000538 11OCT2011 201111 600.00
63000-1000538 15OCT2011 201111 30.00
63000-1000538 15OCT2011 201111 1000.00
63000-1000538 19OCT2011 201111 -5000.00
63000-1000538 20OCT2011 201111 45.00
63000-1000538 20OCT2011 201111 1110.00
63000-1000538 20OCT2011 201111 1971.00
63000-1000538 29OCT2011 201111 92.00
63000-1000538 29OCT2011 201111 329.00
63000-1000538 30OCT2011 201111 22.00
63000-1000538 30OCT2011 201111 200.00
63000-1000538 01NOV2011 201112 249.90
63000-1000538 05NOV2011 201112 35.00
63000-1000538 05NOV2011 201112 1500.00
63000-1000538 08NOV2011 201112 139.29
63000-1000538 09NOV2011 201112 71.00
63000-1000538 09NOV2011 201112 205.69
63000-1000538 10NOV2011 201112 22.00
63000-1000538 10NOV2011 201112 200.00
63000-1000538 11NOV2011 201112 26.00
63000-1000538 11NOV2011 201112 579.90
63000-1000538 11NOV2011 201112 600.00
63000-1000538 18NOV2011 201112 -1000.00
63000-1000538 20NOV2011 201112 45.00
63000-1000538 01DEC2011 201201 312.60
63000-1000538 05DEC2011 201201 30.00
63000-1000538 05DEC2011 201201 1000.00
63000-1000538 10DEC2011 201201 23.00
63000-1000538 10DEC2011 201201 300.00
63000-1000538 16DEC2011 201201 -558.00
63000-1000538 20DEC2011 201201 184.00
63000-1000538 01JAN2012 201202 338.20
63000-1000538 15JAN2012 201202 22.00
63000-1000538 15JAN2012 201202 200.00
63000-1000538 18JAN2012 201202 -1000.00
63000-1000538 20JAN2012 201202 45.00
63000-1000538 01FEB2012 201203 340.10
63000-1000538 04FEB2012 201203 22.00
63000-1000538 04FEB2012 201203 24.00
63000-1000538 04FEB2012 201203 200.00
63000-1000538 04FEB2012 201203 400.00
63000-1000538 20FEB2012 201203 -600.00
63000-1000538 20FEB2012 201203 45.00
63000-1000538 01MAR2012 201204 345.10
63000-1000538 20MAR2012 201204 -650.00
63000-1000538 20MAR2012 201204 45.00
63000-1000538 01APR2012 201205 342.20
63000-1000538 13APR2012 201205 149.00
63000-1000538 14APR2012 201205 22.00
63000-1000538 14APR2012 201205 200.00
63000-1000538 19APR2012 201205 -1000.00
63000-1000538 20APR2012 201205 45.00
63000-1000538 01MAY2012 201206 338.60
63000-1000538 04MAY2012 201206 27.00
63000-1000538 04MAY2012 201206 700.00
63000-1000538 15MAY2012 201206 -19525.48
63000-1000538 20MAY2012 201206 45.00
63000-1000538 01JUN2012 201207 166.70
63000-1000538 06JUN2012 201207 25.00
63000-1000538 06JUN2012 201207 500.00
63000-1000538 09JUN2012 201207 26.00
63000-1000538 09JUN2012 201207 600.00
63000-1000538 14JUN2012 201207 35.00
63000-1000538 14JUN2012 201207 497.95
63000-1000538 14JUN2012 201207 1500.00
63000-1000538 15JUN2012 201207 35.00
63000-1000538 15JUN2012 201207 280.00
63000-1000538 15JUN2012 201207 1500.00
63000-1000538 16JUN2012 201207 29.00
63000-1000538 16JUN2012 201207 900.00
63000-1000538 17JUN2012 201207 29.00
63000-1000538 17JUN2012 201207 900.00
63000-1000538 20JUN2012 201207 -199.00
63000-1000538 01JUL2012 201208 79.20
63000-1000538 05JUL2012 201208 26.00
63000-1000538 05JUL2012 201208 600.00
63000-1000538 20JUL2012 201208 45.00
63000-1000538 26JUL2012 201208 -2600.00
63000-1000538 01AUG2012 201209 132.10
63000-1000538 04AUG2012 201209 26.00
63000-1000538 04AUG2012 201209 600.00
63000-1000538 11AUG2012 201209 30.00
63000-1000538 11AUG2012 201209 1000.00
63000-1000538 20AUG2012 201209 -199.00
63000-1000538 20AUG2012 201209 45.00
63000-1000538 24AUG2012 201209 30.00
63000-1000538 24AUG2012 201209 60.00
63000-1000538 24AUG2012 201209 1000.00
63000-1000538 24AUG2012 201209 4000.00
63000-1000538 27AUG2012 201209 30.00
63000-1000538 27AUG2012 201209 1000.00
63000-1000538 28AUG2012 201209 30.00
63000-1000538 28AUG2012 201209 1000.00
63000-1000538 29AUG2012 201209 30.00
63000-1000538 29AUG2012 201209 1000.00
63000-1000538 01SEP2012 201210 149.70
63000-1000538 15SEP2012 201210 24.00
63000-1000538 15SEP2012 201210 400.00
63000-1000538 19SEP2012 201210 -2500.00
63000-1000538 20SEP2012 201210 45.00
63000-1000538 01OCT2012 201211 275.20
63000-1000538 04OCT2012 201211 24.00
63000-1000538 04OCT2012 201211 199.99
63000-1000538 04OCT2012 201211 400.00
63000-1000538 06OCT2012 201211 282.43
63000-1000538 13OCT2012 201211 40.00
63000-1000538 13OCT2012 201211 1172.20
63000-1000538 13OCT2012 201211 2000.00
63000-1000538 19OCT2012 201211 -500.00
63000-1000538 20OCT2012 201211 45.00
63000-1000538 01NOV2012 201212 302.20
63000-1000538 02NOV2012 201212 108.00
63000-1000538 02NOV2012 201212 150.40
63000-1000538 02NOV2012 201212 229.10
63000-1000538 02NOV2012 201212 240.00
63000-1000538 05NOV2012 201212 200.06
63000-1000538 06NOV2012 201212 303.99
63000-1000538 20NOV2012 201212 -14000.00
63000-1000538 20NOV2012 201212 45.00
63000-1000538 26NOV2012 201212 220.99
63000-1000538 26NOV2012 201212 523.61
63000-1000538 01DEC2012 201301 221.06
63000-1000538 01DEC2012 201301 259.50
63000-1000538 03DEC2012 201301 398.00
63000-1000538 12DEC2012 201301 152.07
63000-1000538 13DEC2012 201301 26.00
63000-1000538 13DEC2012 201301 68.00
63000-1000538 13DEC2012 201301 600.00
63000-1000538 20DEC2012 201301 45.00
63000-1000538 27DEC2012 201301 -700.00
63000-1000538 27DEC2012 201301 179.50
63000-1000538 27DEC2012 201301 778.00
63000-1000538 27DEC2012 201301 1537.00
63000-1000538 01JAN2013 201302 145.90
63000-1000538 02JAN2013 201302 150.00
63000-1000538 02JAN2013 201302 200.00
63000-1000538 11JAN2013 201302 24.00
63000-1000538 11JAN2013 201302 99.00
63000-1000538 11JAN2013 201302 225.00
63000-1000538 11JAN2013 201302 400.00
63000-1000538 12JAN2013 201302 302.18
63000-1000538 17JAN2013 201302 300.25
63000-1000538 18JAN2013 201302 -10000.00
63000-1000538 20JAN2013 201302 45.00
63000-1000538 23JAN2013 201302 198.00
63000-1000538 23JAN2013 201302 299.00
63000-1000538 24JAN2013 201302 64.00
63000-1000538 24JAN2013 201302 87.10
63000-1000538 24JAN2013 201302 300.09
63000-1000538 25JAN2013 201302 82.60
63000-1000538 26JAN2013 201302 352.00
63000-1000538 01FEB2013 201303 132.80
63000-1000538 02FEB2013 201303 500.00
63000-1000538 07FEB2013 201303 25.00
63000-1000538 07FEB2013 201303 500.00
63000-1000538 08FEB2013 201303 90.40
63000-1000538 09FEB2013 201303 59.70
63000-1000538 09FEB2013 201303 81.20
63000-1000538 09FEB2013 201303 248.00
63000-1000538 14FEB2013 201303 288.80
63000-1000538 15FEB2013 201303 361.88
63000-1000538 16FEB2013 201303 500.00
63000-1000538 19FEB2013 201303 -5000.00
63000-1000538 20FEB2013 201303 45.00
63000-1000538 28FEB2013 201303 299.00
63000-1000538 28FEB2013 201303 399.00
63000-1000538 28FEB2013 201303 721.00
63000-1000538 01MAR2013 201304 63.10
63000-1000538 01MAR2013 201304 381.00
63000-1000538 02MAR2013 201304 60.00
63000-1000538 16MAR2013 201304 50.00
63000-1000538 16MAR2013 201304 3000.00
63000-1000538 18MAR2013 201304 24.23
63000-1000538 18MAR2013 201304 423.40
63000-1000538 20MAR2013 201304 -3000.00
63000-1000538 20MAR2013 201304 45.00
63000-1000538 27MAR2013 201304 690.90
63000-1000538 01APR2013 201305 70.80
63000-1000538 08APR2013 201305 358.00
63000-1000538 08APR2013 201305 812.15
63000-1000538 10APR2013 201305 50.90
63000-1000538 11APR2013 201305 196.00
63000-1000538 13APR2013 201305 44.00
63000-1000538 16APR2013 201305 -200.00
63000-1000538 20APR2013 201305 45.00
63000-1000538 22APR2013 201305 35.00
63000-1000538 22APR2013 201305 1500.00
63000-1000538 23APR2013 201305 240.60
63000-1000538 23APR2013 201305 355.19
63000-1000538 24APR2013 201305 44.90
63000-1000538 24APR2013 201305 100.00
63000-1000538 25APR2013 201305 240.56
63000-1000538 25APR2013 201305 274.00
63000-1000538 25APR2013 201305 349.98
63000-1000538 01MAY2013 201306 112.80
63000-1000538 03MAY2013 201306 2999.00
63000-1000538 10MAY2013 201306 284.96
63000-1000538 11MAY2013 201306 446.80
63000-1000538 20MAY2013 201306 -500.00
63000-1000538 20MAY2013 201306 45.00
63000-1000538 22MAY2013 201306 311.28
63000-1000538 22MAY2013 201306 600.00
63000-1000538 23MAY2013 201306 80.90
63000-1000538 23MAY2013 201306 180.00
63000-1000538 23MAY2013 201306 211.70
63000-1000538 24MAY2013 201306 25.00
63000-1000538 24MAY2013 201306 500.00
63000-1000538 29MAY2013 201306 200.07
63000-1000538 01JUN2013 201307 119.00
63000-1000538 01JUN2013 201307 224.70
63000-1000538 06JUN2013 201307 72.80
63000-1000538 06JUN2013 201307 185.00
63000-1000538 07JUN2013 201307 110.00
63000-1000538 07JUN2013 201307 9000.00
63000-1000538 15JUN2013 201307 25.00
63000-1000538 15JUN2013 201307 500.00
63000-1000538 20JUN2013 201307 45.00
63000-1000538 26JUN2013 201307 -14500.00
63000-1000538 28JUN2013 201307 743.00
63000-1000538 29JUN2013 201307 200.11
63000-1000538 29JUN2013 201307 298.00
63000-1000538 29JUN2013 201307 370.00
63000-1000538 01JUL2013 201308 80.00
63000-1000538 01JUL2013 201308 92.00
63000-1000538 01JUL2013 201308 355.00
63000-1000538 02JUL2013 201308 99.70
63000-1000538 03JUL2013 201308 39.90
63000-1000538 03JUL2013 201308 75.00
63000-1000538 05JUL2013 201308 57.60
63000-1000538 05JUL2013 201308 527.60
63000-1000538 05JUL2013 201308 608.73
63000-1000538 05JUL2013 201308 816.00
63000-1000538 13JUL2013 201308 949.00
63000-1000538 14JUL2013 201308 335.00
63000-1000538 15JUL2013 201308 28.49
63000-1000918 31OCT2011 201111 -200.00
63000-1000918 25NOV2011 201112 -523.84
63000-1000918 25NOV2011 201112 247.22
63000-1000918 25NOV2011 201112 276.62
63000-1000918 19JUN2012 201207 -276.55
63000-1000918 19JUN2012 201207 276.55
63000-1000918 23JUN2012 201207 -482.74
63000-1000918 23JUN2012 201207 482.74
63000-1000918 25JUN2012 201207 -4179.00
63000-1000918 25JUN2012 201207 45.00
63000-1000918 25JUN2012 201207 4333.88
63000-1000918 01JUL2012 201208 3.50
63000-1000918 09JUL2012 201208 1698.79
63000-1000918 25JUL2012 201208 -45.00
63000-1000918 25JUL2012 201208 45.00
63000-1000918 25JUL2012 201208 482.74
63000-1000918 25JUL2012 201208 1698.79
63000-1000918 01AUG2012 201209 25.30
63000-1000918 07AUG2012 201209 32.00
63000-1000918 07AUG2012 201209 1200.00
63000-1000918 25AUG2012 201209 45.00
63000-1000918 25AUG2012 201209 730.97
63000-1000918 25AUG2012 201209 1194.50
63000-1000918 29AUG2012 201209 -8306.00
63000-1000918 01SEP2012 201210 87.10
63000-1000918 25SEP2012 201210 631.42
63000-1000918 01OCT2012 201211 3.80
63000-1000918 25OCT2012 201211 -7525.56
63000-1000918 25OCT2012 201211 710.75
63000-1000918 25OCT2012 201211 6082.32
63000-1000918 01NOV2012 201212 10.20
63000-1000918 25DEC2012 201301 341.25
63000-1000918 25DEC2012 201301 363.00
63000-1000918 01JAN2013 201302 2.50
63000-1000918 25JAN2013 201302 -716.65
63000-1000918 31JAN2013 201302 1094.40
63000-1000918 01FEB2013 201303 9.90
63000-1000918 08FEB2013 201303 1076.90
63000-1000918 12FEB2013 201303 499.00
63000-1000918 16FEB2013 201303 203.00
63000-1000918 25FEB2013 201303 -2966.31
63000-1000918 25FEB2013 201303 45.00
63000-1000918 25FEB2013 201303 222.80
63000-1000918 25FEB2013 201303 527.21
63000-1000918 01MAR2013 201304 34.10
63000-1000918 26MAR2013 201304 219.00
63000-1000918 01APR2013 201305 13.60
63000-1000918 15APR2013 201305 -6000.00
63000-1000918 25APR2013 201305 171.99
63000-1000918 25APR2013 201305 178.50
63000-1000918 25APR2013 201305 622.00
63000-1000918 25APR2013 201305 1264.63
63000-1000918 25APR2013 201305 2457.83
63000-1000918 25APR2013 201305 5210.00
63000-1000918 27APR2013 201305 1658.00
63000-1000918 01MAY2013 201306 28.90
63000-1000918 11MAY2013 201306 1766.60
63000-1000918 18MAY2013 201306 888.33
63000-1000918 25MAY2013 201306 -17485.00
63000-1000918 25MAY2013 201306 45.00
63000-1000918 25MAY2013 201306 458.00
63000-1000918 25MAY2013 201306 1461.35
63000-1000918 25MAY2013 201306 1961.91
63000-1000918 25MAY2013 201306 6998.20
63000-1000918 01JUN2013 201307 119.20
63000-1000918 25JUN2013 201307 45.00
63000-1000918 25JUN2013 201307 1513.85
63000-1000918 01JUL2013 201308 54.10
63000-1000918 16JUL2013 201308 626.95
63000-1000918 23JUL2013 201308 2190.50
63000-1000918 25JUL2013 201308 45.00
63000-1000918 25JUL2013 201308 933.50
63000-1000918 25JUL2013 201308 1167.03
63000-1000918 25JUL2013 201308 1334.40
63000-1000918 25JUL2013 201308 6733.41
63000-1000918 25JUL2013 201308 8426.25
63000-1000918 29JUL2013 201308 -2000.00
63000-1000918 30JUL2013 201308 806.00
63000-1000918 01AUG2013 201309 155.90
63000-1000918 09AUG2013 201309 469.50
63000-1000918 23AUG2013 201309 -47236.00
63000-1000918 25AUG2013 201309 45.00
63000-1000918 25AUG2013 201309 2075.19
63000-1000918 25AUG2013 201309 19962.42
63000-1000918 01SEP2013 201310 322.70
63000-1000918 25SEP2013 201310 2181.09
63000-1000918 25SEP2013 201310 5904.73
63000-1000918 30SEP2013 201310 -8531.00
63000-1000918 01OCT2013 201311 -322.70
63000-1000918 01OCT2013 201311 31.20
63000-1000918 01OCT2013 201311 322.70
63000-1000918 25OCT2013 201311 521.55
63000-1000918 25OCT2013 201311 1078.15
63000-1000918 25OCT2013 201311 1142.32
63000-1000918 25OCT2013 201311 2348.52
63000-1000918 31OCT2013 201311 -5000.00
63000-1000918 01NOV2013 201312 15.50
63000-1000918 29NOV2013 201312 -138.00
63000-1000918 01DEC2013 201401 -1.20
63000-1000918 01DEC2013 201401 2.30
63000-1000918 25FEB2014 201403 -643.00
63000-1000918 25FEB2014 201403 643.15
;
Run;
I want ;
Per contractnbr, per end of month the outstanding amount. Preferably also showing months even when there is no change in the amount.
See this:
data want;
set test;
by contractnbr month;
if first.contractnbr
then amount_outstanding = amount;
else amount_outstanding + amount;
if last.month;
drop date amount;
run;
Technically you should define exactly what you mean by "outstanding" amount. Then describe exactly how the amounts shown affect that balance.
My general understanding would be that means the initial balance of an account minus payments and possibly plus additional charges (depends on type of account/ accounting is going on). So I would expect to have a starting known balance before applying any of the monthly amounts shown.
This sums the "amount" value by contractor and calendar month which I would expect to be the change per month.
proc summary data= test nway; class Contractnbr month; var amount; output out=work.summary (drop= _:) sum=; run;
It may help to show what you expect the output to look like.
"Running outstanding amount" seems to indicate that you want a running amount for each record, but then you say
"per month end" which would indicate you only want the value at the end of each month, and not for each record.
So, please clarify.
I am sorry for not making my self clear
I was thinking like:
data want;
input Contractnbr $13. month :yymmn6. NGO;
format month yymmn6.;
datalines;
63000-1000538 201110 10077.5
63000-1000538 201111 15428.3
63000-1000538 201112 18102.08
63000-1000538 201201 19393.68
63000-1000538 201202 18998.88
63000-1000538 201203 19429.98
63000-1000538 201204 19170.08
63000-1000538 201205 18928.28
63000-1000538 201206 513.4
63000-1000538 201207 7338.05
63000-1000538 201208 5488.25
63000-1000538 201209 15302.35
63000-1000538 201210 13421.05
63000-1000538 201211 17359.87
63000-1000538 201212 5683.22
63000-1000538 201301 9247.35
63000-1000538 201302 2521.47
63000-1000538 201303 1773.25
63000-1000538 201304 3510.88
63000-1000538 201305 8027.96
63000-1000538 201306 13525.47
63000-1000538 201307 10918.08
63000-1000538 201308 16084.03
63000-1000538 201309 18074.02
63000-1000538 201310 18436.02
63000-1000538 201311 -1156.2
63000-1000538 201312 -1041.4
63000-1000538 201403 1543.6
63000-1000538 201404 -495.9
63000-1000538 201405 259.65
63000-1000538 201406 -1034.1
63000-1000538 201407 -1031.3
63000-1000538 201508 23968.7
63000-1000538 201509 23042.9
63000-1000538 201510 22520.1
63000-1000538 201511 23639.7
63000-1000538 201512 23115.3
63000-1000538 201601 23675
63000-1000538 201602 23155.8
63000-1000538 201603 23716.5
63000-1000538 201604 -1384
63000-1000538 201605 -1265.9
63000-1000538 201607 23734.1
63000-1000538 201608 23924.9
63000-1000538 201609 24411.9
63000-1000538 201610 -1386.4
63000-1000538 201611 -1388.8
63000-1000538 201612 -1387
63000-1000538 201706 18613
63000-1000538 201707 -1610.7
63000-1000538 201708 -1386
63000-1000538 201709 23614
63000-1000538 201710 -1742.1
63000-1000538 201711 -1489.5
63000-1000538 201809 -1267.5
63000-1000538 201810 1924.7
63000-1000538 201811 8962.64
63000-1000538 201812 -10272.6
63000-1000538 201901 14639.38
63000-1000538 201902 22649.06
63000-1000538 201903 23673.12
63000-1000538 201904 -2079.28
63000-1000538 201905 -1713.58
63000-1000538 201906 -1712.68
63000-1000538 201907 -763.68
63000-1000538 201908 -14156.2
63000-1000538 201909 385.69
63000-1000538 201910 4523.32
63000-1000538 201911 17569.64
63000-1000538 201912 -2361
63000-1000538 204902 -2294
63000-1000918 201111 -200
63000-1000918 201112 -200
63000-1000918 201207 -0.12
63000-1000918 201208 3883.7
63000-1000918 201209 -1194.53
63000-1000918 201210 -476.01
63000-1000918 201211 -1204.7
63000-1000918 201212 -1194.5
63000-1000918 201301 -490.25
63000-1000918 201302 -110
63000-1000918 201303 -492.5
63000-1000918 201304 -239.4
63000-1000918 201305 5337.15
63000-1000918 201306 1460.44
63000-1000918 201307 3138.49
63000-1000918 201308 23455.63
63000-1000918 201309 -1072.36
63000-1000918 201310 -1194.84
63000-1000918 201311 -1073.1
63000-1000918 201312 -1195.6
63000-1000918 201401 -1194.5
63000-1000918 201403 -1194.35
63000-1000918 201404 2182.5
63000-1000918 201405 6324.1
63000-1000918 201406 -1300.32
63000-1000918 201407 5048.83
63000-1000918 201408 3004.53
63000-1000918 201409 868.56
63000-1000918 201410 984.96
63000-1000918 201411 2668.29
63000-1000918 201412 3470.01
63000-1000918 201501 3814.71
63000-1000918 201502 -1266.39
63000-1000918 201503 -1195.09
63000-1000918 201509 39158.41
63000-1000918 201510 39673.71
63000-1000918 201511 38865.02
63000-1000918 201512 -1765.32
63000-1000918 201601 -1194.5
63000-1000918 201604 -1194.89
63000-1000918 201605 -650.54
63000-1000918 201606 -1202.04
63000-1000918 201607 -1194.51
63000-1000918 201703 -265.51
63000-1000918 201704 -1207.6
63000-1000918 201705 -1194.5
63000-1000918 201706 3805.5
63000-1000918 201707 -1264.8
63000-1000918 201708 -164.5
63000-1000918 201709 -1209
63000-1000918 201710 -1194.5
63000-1000918 201711 149.5
63000-1000918 201712 426.6
63000-1000918 201801 -1217.6
63000-1000918 201802 -1194.5
63000-1000918 201808 -1194.5
63000-1000918 201809 -1194.5
63000-1000918 201810 805.5
63000-1000918 201811 -1222.6
63000-1000918 201812 -1194.5
;
Run;
See this:
data want;
set test;
by contractnbr month;
if first.contractnbr
then amount_outstanding = amount;
else amount_outstanding + amount;
if last.month;
drop date amount;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.