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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1346 views
  • 0 likes
  • 3 in conversation