SEARCH FOR SPOOL FILE ACROSS MULTIPLE PRINTQ’S

5 pts.
Tags:
AS/400 printing
AS/400 Spool Files
Is there a way (command or query) to search for a particular spool file name. I have over 100 printq's - some with several thousand spool files. I'd like to scan them similar to what FNDSTRPDM command does for programs.

Software/Hardware used:
AS400 - V5R4

Answer Wiki

Thanks. We'll let you know when a new response is added.

WRKSPLF SELECT(*ALL *ALL *ALL *ALL *ALL xxxxxxxxxx)
Where xxxxxxxx is the FIle name.

This will give you a list where you can view each spool file entry,

To automate this routine, create a CMD

It would receive two parms:
File name
Scan Value

Then do the above command with option *PRINT
Create two temp files in QTEMP. RCDLEN(132)
CpySplf to 1st DB file.
Now read that file and when you have a record that has a detail line with spool file information, do another CPYSPLF to 2nd DB file (Mbropt(*REPLACE)

Now with SQL or FNDSTRPDM or an RPGLE program determine if string is in file.

If yes, you can DSPSPLF, or whatever you want.

============================================================

Why use *PRINT and process a spooled file when it’s easier to do it the right way? Use the <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/QUSLSPL.htm”>List Spooled Files (QUSLSPL) API</a> with format SPLF0300. Loop through the list and check for matches against spoolfile name.

The API will be stable for at least many releases to come. The *PRINT format may change just because someone applied a PTF or issued CHGPRTF.

Tom

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following