Use LISTAGG function in QMF



IBM's flagship relational database management system

Use LISTAGG function in QMF

Postby Prasanna G » Tue Feb 23, 2016 6:26 pm

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.
User avatar
Prasanna G
 
Posts: 59
Joined: Tue Apr 12, 2011 9:49 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Use LISTAGG function in QMF

 

Re: Use LISTAGG function in QMF

Postby BillyBoyo » Tue Feb 23, 2016 9:53 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post