55 pts.
 Copy a spool file
I have a job that generates print files through out the day. The job name, user name and user area are always the same. The job number changes each day. I need to copy the spool file to a physical file so I can pass it to a label printing program, this has to happen all day long. I do not have access to the CL driver program so I can't inbed a WRKJOBA to get the job number. I have tried t do a CPYSPLF externaly but since I can't get the job number i get a duplicate job exists. any ideas ?

Software/Hardware used:
ASKED: April 5, 2006  9:43 AM
UPDATED: April 10, 2006  10:20 AM

Answer Wiki:
this is easily solved by creating a user space and filling using the QUSLSPL or QGYOLSPL API. Then you will be able to read back the list, one item at a time, and do whatever is necessary. I do this to evaluate and delete user spool files all of the time. Works great!! See the Spool file API's in Information Center.
Last Wiki Answer Submitted:  April 5, 2006  1:48 pm  by  DaddyCOZ   0 pts.
All Answer Wiki Contributors:  DaddyCOZ   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

this is easily solved by creating a user space and filling using the QUSLSPL or QGYOLSPL API. Then you will be able to read back the list, one item at a time, and do whatever is necessary. I do this to evaluate and delete user spool files all of the time. Works great!! See the Spool file API’s in Information Center.

 0 pts.

 

You could attach a data queue to the output queue the spool file is written to and have a batch job process the entries as they are created. This only works if the spooled file is in RDY status, if it’s held no entry is sent to the data queue. Check the “Printing” manuals in the infocenter for more information.

 0 pts.

 

Jim Sloan has a set of utilites you can purchase. I believe the utilities are less then $5,000 depending on your processor group. On of the utilities (CVTOUTQ) will create a physical file with a record for each spool file in the output queue. You could read the outfile from CVTOUTQ to find the spool file you need.

 0 pts.

 

Jim Sloan has a set of tools (http://www.taatool.com/) that are fairly inexpensive depending on your processor group. One of the tools (CVTOUTQ) creates a file containing a record for each spool file in an output queue. You can read the file to find your spool file.

 0 pts.