Hmmm, sounds interesting. One concern I'd have with your method would be that if there are a lot of 2 entries, and you write them all to the 3 queue, then a "true" 3 comes in, it's now waiting behind all those 2's you just put out there. Then, as you say, if you need to have a max time for a 2 or 1 to wait, if it doesn't get to it, then your process is actually overwhelmed, so pushing the 2's ahead is only holding up 3's. But let's say this is all OK, and it's what you want. You have two weighting criteria: priority and time. I don't think you can really handle this with dataqs. You probably want to read them into a file with the priority and the time arrived. Then use some kind of algorithm to decide what entry to process next. Possible example: priority*100+secondswait If a priority 3 has been there 1 second, and a priority 1 has been there 2 minutes, 301>220, so the 3 would go first, but by the time the priority 1 has been there 3 minutes and 22 seconds, if a new pri-3 comes in, 301<302, so the pri-1 would go ahead and run. That algorithm doesn't look too good, but you would write something like that to suit your situation. -dan

Reply With Quote