dimanche 17 juillet 2016

SAS Transpose and summarize

I'm working on following scenario in SAS.

Input 1

AccountNumber   Loans
123             abc, def, ghi
456             jkl, mnopqr, stuv
789             w, xyz

Output 1

AccountNumbers  Loans
123             abc
123             def
123             ghi
456             jkl
456             mnopqr
456             stuv
789             w
789             xyz

Input 2

AccountNumbers  Loans
123             15-abc
123             15-def
123             15-ghi
456             99-jkl
456             99-mnopqr
456             99-stuv
789             77-w
789             77-xyz

Output 2

AccountNumber   Loans
123             15-abc, 15-def, 15-ghi
456             99-jkl, 99-mnopqr, 99-stuv
789             77-w, 77-xyz

I manged to get Input 2 from output 1, just need Output 2 now.

I will really appreciate the help.

Thanks!

Aucun commentaire:

Enregistrer un commentaire