Sorry to say, no grouping is required merely to get the count of how many records are in the result set. You might thinking of getting how many of each instance in a group.

*Regards*

*Vern Hamberg*

IBM Champion 2025 <cid:part1.0IslqseQ.Rv7XNKY7@centurylink.net> CAAC (COMMON Americas Advisory Council) IBM Influencer 2023


On 2/12/2026 4:06 PM, JOSE PEREZ wrote:
If I'm not wrong you need a group by to count so group by C6ACDT

Yahoo Mail: Search, Organize, Conquer
On Thu, Feb 12, 2026 at 3:43 PM, Jimmy Sansi<jsansi@xxxxxxxxx> wrote: What about ...

exec sql GET DIAGNOSTICS :Rows = ROW_COUNT;

https://www.ibm.com/docs/en/i/7.5.0?topic=statements-get-diagnostics

On 2026-02-12 12:15, Jerry Forss wrote:

I have a SQL
SqlSelect = 'SELECT C6DcCd, ' +
'C6CvNb, '+
'C6AcDt, ' +
'C6FnSt,' +
'C6B9Cd  ' +
'From ' + %Trim(PurgeXALib) + '/MBC6REP ' +
'Where C6ACDT <= ' + %EditC(PurgeDateCYMD : 'X');

Instead of reading through the cursor, I want the number of records
found.

How do I do that?

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.