|
I still have customers running V2R3 and V3R1 so I'm stuck with supporting some older techniques but this works in either case: 1. Create my data queue: CRTDTAQ DTAQ(mylib/myque) MAXLEN(48) SEQ(*fifo) AUT(*use) 2. Create a data file which will be used for the external definition for the data string. I won't bother with the details, lets just say it contains customer number and sales order number. 3. Have program output to the data queue: No F specs, but an I spec to use data structure defined in step 2 In calcs: CALL 'QSNDDTAQ' Send Data Queue Entry PARM 'myque ' QNAME 10 data queue name PARM 'mylib ' QLIB 10 data queue library PARM 48 QLEN 50 entry length PARM dsname QDATA 48 data sent to queue formatted by DS dsname 4. Have separate program running in background waiting for entries to appear on the queue: No F specs, but an I spec to use data structure defined in step 2 In calcs: *INLR DOWEQ *OFF CALL 'QRCVDTAQ' Receive Data Queue Entry PARM 'myque ' QNAME 10 data queue name PARM 'mylib ' QLIB 10 data queue library PARM QLEN 50 entry length PARM QDATA 48 data in queue PARM 360 QWAIT 50 wait for an hour (specify # of seconds) QLEN CASEQ *ZERO CLNUP timed out, everyone went home CAS RUNIT something appeared END ENDDO The loop will do continuous reads from the queue once data starts to appear. Routine CLNUP sets on LR Rourine RUNIT moves the incomming data QDATA into the externally defined data structure to parse the variables and does whatever you want to do with it. There is also sender information which can be added to the data queue entry. When I reconnect to my AS/400 I'll get the field specs for that and repost this expample with sender information. We use it in a customer support program where multiple users are keying data all day, then during the night an audit report is produced showing what was keyed for each account and who keyed it. James W. Kilgore qappdsn@ibm.net Pardon any typos, I've yet to get a spell checker for my eMail. Also I found a QCLRDTAQ to clear a data queue in a R3M0 CL Programmers Guide (It's the only hardcopy I have at home) +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@midrange.com". | To unsubscribe from this list send email to MAJORDOMO@midrange.com | and specify 'unsubscribe MIDRANGE-L' in the body of your message. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.