BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Agent1592
Pyrite | Level 9

I have the following table:

IDTypeRatio
4106CR1.4
4106IC2
4812CR1.3
5287IC5
7011CR1
7011IC1.5
7011TNW2.5
7849FC0.6
10261FC1
11057TNW0.75
11178CR1.5
11178IC3.75
11178TNW1.1
11452FC1.75

 

How do I summarize the data so I have one row per ID (want table).

IDCRICTNWFC
41061.42  
48121.3   
5287 5  
701111.52.5 
7849   0.6
10261   1
11057  0.75 
111781.53.751.1 
11452   1.75
1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

Do you need to do it using proc sql? Proc transpose was made for such tasks:

 

proc transpose data=have out=want (drop=_:);
  by id;
  id type;
  var ratio;
run;

 

HTH,

Art, CEO, AnalystFinder.com

 

View solution in original post

2 REPLIES 2
art297
Opal | Level 21

Do you need to do it using proc sql? Proc transpose was made for such tasks:

 

proc transpose data=have out=want (drop=_:);
  by id;
  id type;
  var ratio;
run;

 

HTH,

Art, CEO, AnalystFinder.com

 

Agent1592
Pyrite | Level 9

Thank you art.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 757 views
  • 1 like
  • 2 in conversation