Help using Base SAS procedures

Help Please

Reply
Occasional Contributor
Posts: 14

Help Please

Hi,

Can anyone please help me with this?
I need to transfer the following data

Site_ID Meter_Type
30704 24UC
30704 CTRL
31032 24UC
31032 CTRL
31032 CN11

to

Site_ID Meter_Type1 Meter_Type2 Meter_Type3
30704 24UC CTRL
31032 24UC CTRL CN11
Trusted Advisor
Posts: 2,115

Re: Help Please

The procedure that you are looking for is called PROC TRANSPOSE. There are lots of options, so you should read the documentation. EGuide has an easy point-n-click interface that generates the code that you could later use inline.
Super Contributor
Super Contributor
Posts: 365

Re: Help Please

Hello Piggy,

This is a solution:
[pre]data i;
input Site_ID Meter_Type $;
datalines;
30704 24UC
30704 CTRL
31032 24UC
31032 CTRL
31032 CN11
run;
proc transpose data=i out=t prefix=Meter_Type;
var Meter_Type;
by Site_ID;
run;
[/pre]
Sincerely,
SPR
Occasional Contributor
Posts: 14

Re: Help Please

Thanks guys for your help, and my problem has been solved now
Another statment to learn.
Ask a Question
Discussion stats
  • 3 replies
  • 161 views
  • 0 likes
  • 3 in conversation