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.

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

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 1322 views
  • 1 like
  • 2 in conversation