An Idea Exchange for SAS software and services

Comments
by Regular Contributor
on ‎01-06-2017 04:48 PM

This looks like a good example.

by Respected Advisor
on ‎01-06-2017 05:28 PM

I would suggest to duplicate the CATS, CATX, CATQ and CATT functions as SQL aggregate operations when there is only one argument to concatenate, similar to other SAS summary functions such as SUM and RANGE which exist both in the data step and SAS/SQL.

 

For example:

 

proc sql;
select catx(": ", sex, catx(', ', name)) as nameList
from sashelp.class
group by sex;
quit;

 

would give

 

nameList

F: Judy, Jane, Joyce, Barbara, Carol, Mary, Louise, Alice, Janet

M: Philip, James, Henry, John, William, Alfred, Jeffrey, Thomas, Ronald, Robert

by Occasional Learner R_is_better
on ‎10-20-2017 11:16 AM

@PGStats

 

Hi, this doesn't work. Why would you post code along with results that you just made up?

by Respected Advisor
on ‎10-20-2017 01:49 PM

@R_is_better, maybe, to be more explicit, I should have framed the code with:

 

/* This code is an example of a proposed SAS/SQL addition. IT DOESN'T WORK IN SAS 9.4 */

Idea Statuses
Top Liked Authors