|
boothm@ibm.net wrote: > > > Data queue. There's that word again. I want to read about it but can't > find it in a redbook. Where is there a good discussion of Data Queues? > You can always find a good discussion right here! :) Data Queues are a real handy tool to use. We use them for any print on demand type of function, like shipping documents, picking slips, counter invoices, etc. Data queues can be indexed, sequencial FIFO or LIFO. Imagine a bunch of people doing order entry, when the order is completed they press a function key to start a new order. At this time, the order entry program outputs a record to a data queue. Another program is running all on it's own in the background waiting for entries to appear on the queue, when one does, it reads it and produces a warehouse picking slip. A couple of things to remember: Records are deleted from the queue when received by a program. You can always put the entry back on the same queue or pass it on to another queue. The only way I know of to reclaim the space occupied by a queue is to delete the queue then recreate it. When createing the queue, you specify a maximum record length, although all entries do not have to be that length, just don't try to read past the incomming data string. Unless you have a lot of records, using indexed data queues is a nice way to sort entries shown on a screen. Let's say you have a hundred entries in a subfile in name order and you want to offer the user a function key to sort by date order, like PDM allows you to sort by date or member name. You read through your subfile and output each entry to an indexed data queue, when done, read back the data queue and recreate the subfile. Viola' - inline sorting within an RPG program. In our impementation our data queue entries have three fields: Verb: contains things like *END to seton LR in the receiving program. Format: contains the name of the data structure that maps the incomming data Data: actual data string We define physical files for each data queues data format that we can us as externally defined data structures in both the creating and receiving programs. Let the games begin! James W. Kilgore qappdsn@ibm.net +--- | 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.