Re: Replacement for XMLAGG in SAS

The product Number looks like this 'ABCD0000000345789479607'. Each customer (ID) have several Product Numbers. One customer can have 1 to 5000 product numbers. I used the same query and increased the length to 32767 (max). 23*5000=115,000. I don't think we can increase the length. The same reason oracle throwed me error in XMLAGG function.

Re: Replacement for XMLAGG in SAS

How long did you make the LENGTH of the target variable? If a variable is to hold a comma delimited list it would need 26*14 characters for the product and an additional 13 for commas between 14 of them. Total 335. Less than that is likely not to hold any group requiring all 14 variables.

Likely the length of your resulting variable is around 160 OR you getting lots of blanks carried around for some reason.

It never hurts to show the actual code you ran as we can't see anything you don't share and have to ask questions that would be answered by the code.