Create a gist now

Instantly share code, notes, and snippets.

proc sort data = bank ;
by CardID ;
run ;
data bank_mod (drop = i month Expense) ;
set bank ;
by CardID ;
if _n_ = 1 then do ;
array Expensex(3) Expense1 - Expense3 ;
end ;
retain Expense1 - Expense3 ;
if first.CardID then do ;
do i = 1 to 3 ;
Expensex(i) = . ;
end ;
end ;
Expensex(month) = Expense ;
if last.CardID then output ;
run ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment