PDA

View Full Version : QUSLSPL & QUSRSPLA



Guest.Visitor
12-15-2003, 12:42 PM
I need help. I'm trying to retrieve the attributes of the latest spooled file in a specific outq with a specific formtype. Once I get the attributes I call an RPG which prints a report, then I check another outq. Because of the looping I can't use a RCVF. The QUSLSPL is supposed to sort by status, output priority, date and time according to the API Reference manual. Since status and priority will be the same for all the splf, I would think they would be in date order. In the outq, the splf with the oldest date has the largest job number. When I run the program, the report always lists the splf with the oldest date/largest job number instead of the one with the latest date no matter how I change the program. What am I doing wrong?? Thanks in advance for any help. John <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6ae84960')

Guest.Visitor
12-15-2003, 12:42 PM
Have you considered using a data queue attached to the outq? As spooled files are added to the outq, entries are written to the data queue. A "sleeper" program can then retrieve the next data queue entry, which should be the last spooled file created, and you can use QUSRSPLA on that specific spooled file. Hope that helps, --Bruce