Page 1 of 1

Use LISTAGG function in QMF

PostPosted: Tue Feb 23, 2016 6:26 pm
by Prasanna G
Hi

I am not able to use the below SQL in QMF mainframes. I am getting syntax error (-199 SQLCODE). Seems like the LISTAGG function is available only for Unix, Linux and Windows.. Is there any equivalent command for mainframes?

We are using DB2 Version 11.1


SELECT NAME, LISTAGG(TBNAME, ',') WITHIN GROUP (ORDER BY TBNAME) AS C
FROM SYSIBM.SYSCOLUMNS WHERE
NAME = 'AC_XTNL_SQ_NO' GROUP BY NAME;
 


Thanks
Prasanna G.

Re: Use LISTAGG function in QMF

PostPosted: Tue Feb 23, 2016 9:53 pm
by BillyBoyo
If you read through this, http://www.idug.org/p/fo/et/thread=41440, there are about three possibilities for z/OS. I think XMLAGG is the simplest and closest.