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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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