To add to Mark's excellent answer, here's an old midrange.com discussion that shows the following example:

eg. CALL QCLRDTAQ ('DataQueueName' 'LibraryName')

It's got to be much faster than invoking SQL to call it.

On 7/3/2024 9:36 PM, Mark Waterbury wrote:
Hi, Don,

QSYS2.CLEAR_DATA_QUEUE is an SQL user defined function procedure.  You can see it listed in the SQL catalog in table (or view) SYSPROCS.

   select * from sysprocs where procname = 'CLEAR_DATA_QUEUE'

So, you cannot just bind to it or call it like some ILE procedure.

CL does not directly support "embedded SQL".

You might be able to invoke it from a CL program via the CL command RUNSQL or similar.

It may be easier to simply call the original API named QCLRDTAQ.  It is an OPM *PGM so easily CALLed from CL, or whatever.

Hope that helps,

Mark S. Waterbury

On Thursday, July 4, 2024 at 12:15:11 AM EDT, Don Brown via MIDRANGE-L<midrange-l@xxxxxxxxxxxxxxxxxx> wrote:
Hi

I want to use the procedure to clear a data queue in a CL program.

I can not find any binding directory with this procedure.

How do I compile the program, the module compiles ok but the program fails as it can not find the procedure.

Thanks

Don


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.