× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi all,

I am working on a program that needs to wait for entries to be put into a
user defined data queue and process them.  I have read how data queues work
but I am confused on some things.  What would I specify for a wait time if I
wanted to process a queue entry as soon as it hits the data queue?

Also, once I have my program done that calls API QRCVDTAQ do I just submit
it to batch and let it run?  It seems that it would just loop and take up a
lot of processor time??  Or is that where the 'wait time' parm comes in?

Here is an example of what I am talking about concerning it just looping and
taking up processor time:

     D dqName          s             10    inz('JMDTAQ')
     D dqLib           s             10    inz('QGPL')
     D dqLen           s              5  0 inz(10000)
     D dqData          s          10000
     D dqWait          s              5  0 inz(5)

     D from            S             50
     D to              S             50
     D replyTo         S             50
     D subject         S             50
     D filename        S            100
     D text            S          32767
     D rtnCode         S              3
     D rtnText         S             50

      /FREE
        dow 'something' <> 'somethingelse';
         exsr $qRcvDtaQ;

         if dqLen > 0;
           from = 'heyYou@home.com';
           to = 'snoopy@loopy.com';
           replyTo = 'bartell@homeless.com';
           subject = 'JavaMail from Aaron Bartell';
           text = 'This is the body of the email';
           exsr javaMail;
         endif;
        enddo;

       *inlr = *on;
      /END-FREE
     C     $qRcvDtaQ     begsr
     C                   call      'QRCVDTAQ'
     C                   parm                    dqName
     C                   parm                    dqLib
     C                   parm                    dqLen
     C                   parm                    dqData
     C                   parm                    dqWait
     C                   endsr
     C     javaMail      begsr
     C                   call      'JAVAMAIL'
     C                   parm                    from
     C                   parm                    to
     C                   parm                    replyTo
     C                   parm                    subject
     C                   parm                    text
     C                   parm                    filename
     C                   PARM                    rtnCode
     C                   PARM                    rtnText
     C                   endsr

Thanks in advance,
Aaron Bartell


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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

This mailing list archive is Copyright 1997-2024 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.