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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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