SAS SQL to aggregate rows -


I'm new to SAS and I create a column with data from each group of IDs with a large dataset I am working.

ID Name

  1 AAA 1 AAA 1 BBB 2 CCC 2 CCC 2 AAA 3 DDD 3 BBB 3 AAA 4 BBB 4: A simplified version of my dataset looks like this And the result I am looking for is:  

ID name NEW_ID

  1 AAA AAA, BBB1 AAA AAA, BBB 1 BBB AAA, BBB 2 CCC CCC, AAA 2 CCC CCC, AAA 2 AAA CCC, AAA 3 DDD DDD, BBB, AAA 3 BBB DDD, BBB AAA 3 AAA DDD, BBB, AAA 4 BBB BBB  

Many of your help Remember Hanna is that ID can not always come in the form of a number. Thank you.

I can not think in a way to do this in the same data phase. But 2 is very easy to collect values ​​first and then add them back to the main data set.

  Data first; Is set; By ID; Format $ COL $ 2000; Maintaining Cal; If ^ last.id then col = col || Patti (name) || ""; Do more; Col = Patti (Colonel) || Strip (name); Output; End; Run; Want data; Merge is the first; By ID; Run;  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -