The Scan Spooled File 2 command scans selected spooled files for a
string and displays or prints the results. This allows searching for
a string that exists in the spooled data such as in job logs. The
QUSLSPL API is used to determine the selected spooled files.
A typical command would be:
SCNSPLF2 STRING('xxx') OUTQ(ABC)
All spooled files in the output queue ABC and the current user would
be scanned for the specified string value. If the value is found, a
line is listed with the fully qualified job name, the spooled file
name and number, the open date and time, and 42 bytes of the spooled
file data beginning with the scan value that was found.
Note that the first string value found causes a line to be listed.
No further scanning of that spooled file occurs.
The spooled files must be able to be read by CPYSPLF in order to
allow scanning. This allows for normal DP output (no special
graphics or AFP output).
Scanning method
---------------
Both the STRING value and each spooled file line are translated to
upper case before scanning. Thus a STRING of 'abc' or 'ABC' will be
satisfied by a spooled file line containing 'ABC' or 'abc'.
The length of the string is determined by scanning the string from
the right to determine the length of the first non-blank. Thus a
string of ABC will be satisfied by a spooled file line containing
'ABC ', 'ZABC', or 'ABCD'.
If a string is entered with a leading blank such as ' BCD', it will
not be satisfied by a spooled file line containing 'ABCD'. If a
leading blank is required, you must enter the value in quotes.
If you want to scan for a string with a trailing blank eg 'ABC ', you
must specify the actual string length to be scanned for using the
STRLEN parameter. If you specified STRLEN(4), a spooled file line
containing 'ABCD' would not be satisfied, but 'ABC D' would be.
Performance considerations
--------------------------
The QUSLSPL API is used for selection by the sub tool CVTWRKSPLF.
This provides a fast retrieval for the following selections:
- Job
- User
- Job number
- Output queue
- Form type
- User data
All other selection is done via TAA code in CVTWRKSPLF. If you can
select on the basis of one of the previous values, the number of
spooled files that must be scanned can be considerably less.
SCNSPLF2 escape messages you can monitor for
--------------------------------------------
TAA9892 No spooled files were found to be scanned.
Check your selection criteria.
TAA9893 The string was not found in any of the selected
spooled files.
Escape messages from based on functions will be re-sent.
SCNSPLF2 Command parameters *CMD
---------------------------
STRING The string to be scanned. Both the string and the
spooled file lines are translated to upper case
before scanning. Thus a STRING of 'abc' or 'ABC'
will be satisfied by a spooled file line containing
'ABC' or 'abc'.
For handling of leading or trailing blanks in the
string, see the section on 'Scanning method' in the
tool documentation.
USER The user you want to select on. This parameter is
the same function as the USER parameter on the
WRKSPLF command.
*CURRENT is the default for the current user
profile.
FORMTYPE The form type you want to select on. The default is
*ALL. This parameter is same function as the
FORMTYPE parameter on WRKSPLF.
USRDTA The user data you want to select on. The default is
*ALL. This parameter is same function as the USRDTA
parameter on WRKSPLF.
FILE The name or generic name of the spooled file to
select on. The default is *ALL for all spooled
files.
JOB The job name of the spooled file to select on. The
default is *ALL for all jobs.
JOBNBR The job number of the spooled file to select on.
The default is *ALL for all job numbers.
OUTQ The qualified name of the output queue to select.
The output queue name defaults to *ALL. A specific
or generic name may be entered.
The qualified library name defaults to *ALL. A
specific library name, or *CURLIB may be used.
NBRPAGES The number of pages in the spooled file to select
on. The default is *ALL for any number of pages.
If a number is entered, any spooled files with at
least that number of pages are selected.
SPLFSIZE The size of the spooled file in bytes to select on.
The default is *ALL for any size. If a number is
entered, any spooled files with at least that size
in bytes are selected.
PGM The name of the program and library that opened the
spooled file to select on. The default is *ALL for
both the program and library name. If a name is
entered in either or both parameters, only those
spooled files that were opened by that program name
and library will be selected.
Each part of the qualified name is considered
separately. For example, if a program name is
entered with a library value of *ALL, any spooled
file opened by that program name will be selected
regardless of the library the program exists in.
HOLD Whether to select on the spooled files that are
held. The default is *ALL for whether the spooled
file is held or not.
If *YES is entered, only those spooled files that
are held will be selected.
If *NO is entered, only those spooled files that are
not held will be selected.
SAVF Whether to select on the spooled files that are
specified as SAVE(*YES). The default is *ALL for
whether the spooled file is saved or not.
If *YES is entered, only those spooled files that
are saved will be selected.
If *NO is entered, only those spooled files that are
not saved will be selected.
PERIOD The Begin/End Date/Time values to select on.
The 'Beginning time' value defaults to *AVAIL
meaning the Begin Time value is not considered. If
a time is entered, it is used in conjunction with
the 'Beginning Date' to determine selection.
The 'Beginning Date' value defaults to *BEGIN
meaning the Begin Date value is not considered. If
a date is entered, it is used in conjunction with
the 'Beginning Time' to determine selection. The
special value *CURRENT may be entered to mean todays
date.
The 'Ending time' value defaults to *AVAIL meaning
the End Time value is not considered. If a time is
entered, it is used in conjunction with the 'Ending
Date' to determine selection.
The 'Ending Date' value defaults to *END meaning the
End Date value is not considered. If a date is
entered, it is used in conjunction with the 'Ending
Time' to determine selection. The special value
*CURRENT may be entered to mean todays date.
LISTSPLF Whether to list all selected spooled files or use
the default.
*DFT is the default which will list one line for
every spooled file where the string was found and
those files which could not be processed by CPYSPLF.
For example, an AFP file cannot be read by CPYSPLF.
*ALL may be specified to list all selected spooled
files.
STRLEN The length of the string to be scanned.
*DFT is the default which means to scan the string
value from the right to determine the last
non-blank. If you enter a string of 'ABC', the scan
will be for 3 bytes.
A number between 2 and 20 may be entered if you want
to scan for a value which contains trailing blanks.
For example, if you want to scan for 'ABC ', the
default is to scan for 3 bytes. By entering
STRLEN(4), a scan would occur for 'ABC '.
OUTPUT How to output the results. * is the default to
display the spooled file if the command is entered
interactively. The spooled file is deleted after it
is displayed.
If the command is entered in batch or *PRINT is
specified, the spooled file is output and retained.
Restrictions
------------
The spooled files must be able to be read by CPYSPLF in order to
allow scanning. This allows for normal DP output (no special
graphics or AFP output).
Prerequisites
-------------
The following TAA Tools must be on your system:
CVTDAT Convert date
CVTWRKSPLF Convert work spooled file
EDTVAR Edit variable
RTVDAT Retrieve date
RTVSYSVAL3 Retrieve system value 3
SNDCOMPMSG Send completion message
SNDESCINF Send escape information
SNDESCMSG Send escape message
SNDSTSMSG Send status message
TRNVAL Translate value
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
SCNSPLF2 *CMD TAASPOU QATTCMD
TAASPOUC *PGM CLP TAASPOUC QATTCL
TAASPOUC2 *PGM CLP TAASPOUC2 QATTCL
TAASPOUR *PGM RPG TAASPOUR QATTRPG
TAASPOUR2 *PGM RPG TAASPOUR2 QATTRPG
Structure
---------
SCNSPLF2 Cmd
TAASPOUC CL pgm - Uses CVTWRKSPLF
TAASPOUC2 CL pgm - Uses CPYSPLF
TAASPOUR RPG Pgm to do scan
TAASPOUR2 RPG Pgm to print
|