55 pts.
 Reorganize OUTQ
How do I organize files of output queue. Please help.

Software/Hardware used:
ASKED: December 8, 2011  7:59 AM
UPDATED: March 17, 2012  6:28 AM

Answer Wiki:
The simple answer would be to use WRKOUTQ to *print, then construct a subfile view over the result to allow you to interrogate a given outq. Bear in mind though, that such processing will be permanently out of date. Doubtless you could speed things up with the appropriate API, but it isn't an area I've ever felt needed investigation.
Last Wiki Answer Submitted:  December 8, 2011  3:57 pm  by  Yorkshireman   5,505 pts.
All Answer Wiki Contributors:  Yorkshireman   5,505 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Organizing files on an output queue isn’t making much sense. Can you describe the result that you want? Why do you think the files aren’t organized in the first place?

Tom

 108,055 pts.

 

What do you actually meant for ‘Organize’ in this case?

Pradeep.

 3,370 pts.

 

I want to organize the outq files according to records.

 55 pts.

 

HS
Spool Files are reported in the number of pages, not lines or records.
I don’t think you can get what you want without programming.
Even getting a list of these ordeered by pages takes a bit of work.
Phil

 44,180 pts.

 

On an AS/400?

 44,180 pts.

 

Everyone is a little baffled at your question. Tom may have a better analogy than this, but I think of an outq as a physical file where each spooled file is a member, or at least a pointer to a member. The organization is determined by the system on spooled file status and arrival sequence.
If you are trying to have spooled file ordered by report type so different users can find what they need, you would probably accomplish that having the different reports or types or whatever your trying to “organize” sent to different outqueues by the programs that generate them.

 2,865 pts.

 

As Phil says, spooled files are generally reported by number of pages rather than number of records. Depending on how a printer file is defined, an entire page might be defined as a single record or might contain many records. I haven’t done it, but I suppose that a single record could even include multiple pages.

In any case, since iSeries Navigator already lets you sort by number of pages, it seems pointless to try to sort by “number of records”.

You could certainly create programming to do it. You’d have to create screens for the display as well as the programming that retrieved “number of records” from each output queue entry and then sorted the results.

But it seems kind of pointless.

If this needed to be done, it might make more sense to do it by spooled file size than by “number of records”.

Tom

 108,055 pts.

 

I think of an outq as a physical file where each spooled file is a member, or at least a pointer to a member.

I don’t have a better analogy. An output queue is more like a list of pointers to members. The output queue doesn’t actually hold any files. It’s just a kind of index object that holds entries with attributes of each spooled file plus a pointer to where the spooled file really is. There would be a lot more data movement when a spooled file (entry) is moved from one output queue to another if the queues actually held the spooled data. As it is, about the only thing that moves between queues is the index entry.

A DMPOBJ command (over a queue with only a few entries) shows most of what is useful.

Tom

 108,055 pts.

 

If you really want to “reorganize”, I suppose you could call the List Spooled Files (QUSLSPL) API perhaps using format SPLF0300. Sort the user space by spooled file size, then read the entries one at a time.

If you create a temporary *OUTQ, you could move each entry to the new queue with CHGSPLFA. Since they’re sorted, the entries should get queued in the new order.

Either display the new outq or use the API a second time to loop through again, putting them back where they started but in the new sequence. Displaying the new outq might not be a good choice — something needs to be done with the files.

As for what you would do about different priorities or statuses, that would be up to you to decide.

Tom

 108,055 pts.

 

Do you actually need to re-order the contents of the queue or do you just need to see the entries in a particular sequence?

 5,670 pts.