The SCNALLSRC command provides a simple method of scanning all or
some source files in a library. By default, only standard source
files (QCLSRC, QRPGSRC, etc) are scanned. All source files may also
be scanned. An outfile is optional.
To scan the library SALES for all use of the argument ACCRCV you
would specify:
SCNALLSRC ARGUMENT(ACCRCV) LIB(SALES)
The SCNALLSRC command submits a job to batch to perform the scan.
The job description specified in the user profile is used by default.
The SCNALLSRC command uses the SCNSRC command (TAA Tool SCNSRC). A
spooled file is created for each source file name processed. All
standard source files in the library would be scanned. The spooled
file name will be the name of the file scanned. The spool USRDTA
field will be SCNSRC.
By default a spooled file is created for each source file. You can
eliminate the source files that do not contain the argument to be
scanned for by specifying DLTSPLF(*YES).
An option on the command exists to specify the source types that you
want to scan. For example, you could have specified:
SCNALLSRC ARGUMENT(ACCRCV) LIB(SALES) TYPE(*CL *RPG)
This would have caused a scan against only the files QCLSRC and
QRPGSRC.
Contrast with SCNGENSRC
-----------------------
The SCNALLSRC command scans every member in a file using the OVRDBF
MBR(*ALL) option. This causes every member to be opened and scanned.
SCNALLSRC defaults to process only the standard source file names in
a library.
The SCNGENSRC command scans only the generically named members in a
file. If a small percentage of members in the file match the generic
name, performance is better with SCNGENSRC. SCNGENSRC defaults to
process all source files in a library.
SCNALLSRC escape messages you can monitor for
---------------------------------------------
TAA9893 Argument was not found in any source file
Escape messages from based on functions will be re-sent.
Command parameters *CMD
------------------
ARGUMENT Up to 20 bytes to use in the scan. You may need to
surround the value in quotes and enter in upper case
depending on the value. For typical field names
(e.g. ACCRCV), the value may be entered in lower
case without quotes. Trailing blanks will be
trimmed off. For example, 'ABC ', will be treated
as 'ABC'.
To scan for lower case in the source, enter the
value in quotes such as 'abc' and specify
TRANSLATE(*NO).
LIB The library name which contains the source files to
be scanned. The default is *DFT meaning the current
library if it exists and if not the first library on
the user portion of the library list is used.
TYPE The source type that should be scanned. The default
is *STD meaning the system supplied source files
such as QCLSRC, QCMDSRC, etc as defined in the help
text for the system. For a listing of these, use
the PRTSRCTYP tool.
*ALL may be specified to scan all source files in
the library.
*SRC1, *SRC2, and *SRC3 mean that a data area must
exist on the library list by the corresponding names
of SRCLST1, SRCLST2, and SRCLST3. These data areas
must contain the name of the source files to be
checked. Only source files that exist and match one
of those found in the data area will be checked.
See the discussion with the CRTSRCFLST tool.
*QATT or *QATT may be specified to mean the only
files checked must match those described in the
RTVQATTF TAA Tool. This is either a short or long
list of QATTxxx source file names. Use the PRTQATTF
command for a listing of the files.
Using *QATT requires that you must know the Tool ID
to specify as the generic name. The Tool ID can be
determined using DSPTAA and the name in the upper
right hand corner of the first page. For example,
the Tool ID for ADDDAT is TAADATA. The *QATT values
only work against normal source files and not the
TAA Archive.
Special values such as *PF (meaning QDDSSRC) or *RPG
(meaning QRPGSRC) may also be entered.
If a specific type is requested, it must exist. If
a special value such as *STD is used, missing source
files are ignored.
TRANSLATE A *YES/*NO option that defaults to *NO. *YES causes
the source statement to be translated to upper case
before scanning for the argument.
ADDBLANKS The number of blanks to add to the end of the
argument before scanning.
0 is the default meaning the length of the data for
each argument determines what is scanned for.
A value in a range of 0 to 3 must be entered.
The intent of this parameter is to provide for the
situation such as when you want to scan for the end
of a name or word ending in 'red', but you do not
want words such as 'redeem'. Using ADDBLANKS(1)
finds any words such as 'altered' which are followed
by a blank.
CHGDAT The date to compare individual source statements to.
*NONE is the default meaning all source statements
are considered.
A date may be entered in job format to compare to
the individual source statements change date
(positions 7-12) of a source statement. If the
source statement was changed on or after the
specified CHGDAT, it will be considered for listing.
Specifying a CHGDAT value can reduce the number of
print lines that must be reviewed.
SELCOL6 Whether to select only certain source records based
on the value of column 6 of the source data portion
of the record. The default is *ANY meaning that
column 6 is not considered and the entire data
portion of the record is scanned.
This option is designed for RPG/RPGLE and to allow
selection of the type of specification such as I, D,
C, etc. For example, if C is entered, only
statements with a C in column 6 of the source data
will be scanned. Note that this may include some
array and table data.
A value should only be entered when you are limiting
the scan to RPG/RPGLE source types. The scan which
occurs is not sensitive to the source type and would
probably provide misleading information if a non-RPG
type of source was scanned.
PRTFOLSTM A *YES/*NO option that defaults to *NO. *YES means
that if a hit is found on a statement, the next
statement will be printed whether it has a hit or
not.
The purpose of the *YES option is for a situation
such as when you are scanning for a command name and
want to determine whether a keyword has been used.
If the command is continued to a second source
statement, the keyword you may want to look for
could be on the second line. After the spooled file
is output, you can use DSPSPLF to scan for the
keyword.
DLTSPLF A *YES/*NO parameter for whether to delete the
spooled file if no arguments were found.
*NO is the default meaning one spooled file would be
created for each source file found.
*YES may be specified to delete the spooled files
that do not contain a matching argument.
OUTLIB The library in which the file SCNSRCP will be
placed. The default is *NONE meaning no outfile is
created.
A library may be named or *LIBL or *CURLIB if the
SCNSRCP file exists.
The file will contain one record for each detail
print line.
If the SCNSRCP file does not exist, a library must
be specified.
OUTMBR The member of the SCNSRCP file to be used. If the
member does not exist, it is added. The default is
SCNSRCP.
REPLACE A *YES/*NO value for whether the member should be
cleared before writing records into it. The default
is *YES to clear the member before adding records.
*NO may be specified to add records to an existing
member.
JOBD The job description to submit the job for. *USRPRF
is the default to use the job description specified
for the user profile.
A specific job description may be named. If the
library value is blank, *LIBL is assumed. A
specific library or *CURLIB may also be used.
Restrictions
------------
There is a limit of 999 source files in a library.
Prerequisites
-------------
The following TAA Tools must be on your system:
EXTLST Extract list
RTVLIBSRCF Retrieve library source files
SCNSRC Scan source
SNDCOMPMSG Send completion message
SNDDIAGMSG Send diagnostic message
SNDESCMSG Send escape message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ----- --------- ---------- -----------
SCNALLSRC *CMD TAASRCE QATTCMD
TAASRCEC *PGM CLP TAASRCEC QATTCL
TAASRCEC2 *PGM CLP TAASRCEC2 QATTCL
TAASRCEC3 *PGM CLP TAASRCEC3 QATTCL
TAASRCEC2 is submitted if a specific source type is named. TAASRCEC3
is submitted if a special value is used.
|