|
The wait time is the maximum time you want to wait before timing out. When entries are put on the data queue your program is notified immediately, regardless of what the wait time is. You can tell if an entry was received by checking the length field, as you do in your program. If it is zero then the data queue timed out. BTW, if you don't want to time out at all, use a wait time of minus one (-1). Control won't be returned to your program until something comes in on the data queue. Albert York -----Original Message----- From: Bartell, Aaron L. (TC) [SMTP:ALBartell@taylorcorp.com] Sent: Tuesday, July 23, 2002 3:18 PM To: 'rpg400-l@midrange.com' Subject: QRCVDTAQ (Receive Data Queue) program 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 _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.