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

Pivot SAS dataset Ideas

Status
Not open for further replies.

sap1958

Technical User
Oct 22, 2009
138
US
proc sql;
create table test as
select ln_no,thismonth,lastmonth
from mytest;
quit;

sample output
ln_no thismonth lastmonth
1123 current 30 day
1344 30 day current
24333 current 60 day
2445 current 60 day

I need to pivot the data using thismonth as the row, lastmonth as the colum and a count of the variable elements based on the loan numbers.
Desired output

Status Current 30Day 60Day Totals
Current 1 1
30 Day 1 1
60 Day 2 2

I know how to pivot the data in excel but have trouble with proc transpose in sas. Alternately if there is a way to export the raw data to excel, create the pivot table, then import it into sas, let me know. By the way I am using Enteprise Guide 5.1. I see a transpose feature there and have tried to experiment with it

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top