5 pts.
Q:
SEARCH FOR SPOOL FILE ACROSS MULTIPLE PRINTQ'S
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
ASKED: Aug 12 2009  3:23 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
18875 pts.
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • Bookmark and Share
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 List Spooled Files (QUSLSPL) API 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
Last Answered: Nov 26 2009  10:57 AM GMT by TomLiotta   18875 pts.
Latest Contributors: CharlieBrowne   7855 pts., Whatis23   5475 pts.
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _