280 pts.
 Log for *OUTQ
I would like to know a way to get a log of all prints done through an out queue. 



Software/Hardware used:
AS400
ASKED: August 13, 2009  12:31 PM
UPDATED: November 27, 2009  10:08 AM

Answer Wiki:
Have you tried the Retrieve Output Queue Information (QSPROUTQ) API ? =========================================================== Enable job accounting. Create a journal receiver. Create journal QSYS/QACGJRN and attach the receiver to it. Set system value QACGLVL to *PRINT. All print activity will then be logged in QACGJRN. Tom
Last Wiki Answer Submitted:  November 26, 2009  10:29 am  by  Satsho   1,245 pts.
All Answer Wiki Contributors:  Satsho   1,245 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

You could make it a monitored printq, and add a logging recorder into the data queue handler. you’d have a log of what was released ( therefore, we assume, printed) that was up to the millisecond.

 5,505 pts.

 

Hi, Yorkshireman

How do I create a monitored printq?! and what is a logging recorder – terms look new to me, appreciate you help on this!

 280 pts.

 

Sorry, I forget not everyone knows all the corners of the i5 maze.

If you review
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/clpdf/SS1-6.pdf

in the section about OUTQ’s you will find how to create an associated data Q.

When a spooled item becomes ‘Ready’ , the Data Q is notified. Your program takes the entry details from the Q, and writes them to a file. I referred to this program as a recorder. You need to write it.

As a means of recording all details of all items – this is the bees leg joints.

Heres the bit from the book

Specifies the data queue associated with the output queue. Entries are logged in the data queue when spooled files are in ready (RDY) status on the output queue. A user program can determine when a spooled file is available on an output queue using the Receive Data Queue API (QRCVDTAQ) to receive information from a data queue.
Each time a spooled file on the output queue reaches RDY status, an entry is sent to the data queue. A spooled file can have several changes in status (for example, RDY to held (HLD) to release (RLS) to RDY again) before it is taken off the output queue. These status changes result in entries in the data queue for a spooled file each time the spooled file goes to RDY status.

 5,505 pts.

 

Here’s the layout for the data queue:

D Data            Ds                 
D  function                     10   
D  type                          2   
D  job_name                     10   
D  user_name                    10   
D  job_number                    6   
D  spool_file                   10   
D  spool_num_bin                 8b 0
D  outq_name                    10   
D  outq_library                 10   
D                               56   
 5,670 pts.

 

If AUDITING is turned on and system value QAUDLVL contains *SPLFDTA and *PRTDTA you could extract the SF and PO entries from the audit journal. You would need to interpret the different journaling codes, but you would get a good idea of what happens with spoolfiles on your system.
I used this to track obsolete output queues and devices.

 2,250 pts.