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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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