BookmarkSubscribeRSS Feed
piggy
Fluorite | Level 6
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
3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12
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.
SPR
Quartz | Level 8 SPR
Quartz | Level 8
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
piggy
Fluorite | Level 6
Thanks guys for your help, and my problem has been solved now
Another statment to learn.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 966 views
  • 0 likes
  • 3 in conversation