The Scan Command Keyword command scans source for the use of a
specific keyword on a command. One, multiple, or all libraries can
be scanned. All source files in each library are checked for the
source types CL, CLP, CLLE, CL38, and CLP38. The output listing
describes one line for each occurrence found.
A typical command to scan all source files on the system in libraries
except TAATOOL that do not begin with Q would be:
SCNCMDKWD CMD(xxx) KWD(yyy) LIB(*ALLNONQ) +
The listing would contain one line for each statement found in a CL
source type that contained the specific keyword used on the named
You must have *USE authority to the TAACVTLIBD authorization list to
use the special values of *ALL, *ALLUSR2, or *ALLNONQ.
SCNCMDKWD operates by reading each CL source member and building up
the statement in a large variable. A command can be spread of over
multiple lines (up to 5000 bytes). The command is extracted and if
it matches the CMD parameter, a scan is used for the KWD parameter
value plus ')'. For example, if you specified KWD(JOBD), the scan
would be for 'JOBD('.
You may also include in the scan the first character of the parameter
value so that you can scan if a variable name is used, a special
value, or a constant. See the FSTCHAR parameter.
A USAGE option exists to allow a listing of those commands with the
keyword, without the keyword, or both.
** Only the source types CL, CLP38, and CLLE are checked for.
The difference with CLP38 qualified names is not considered.
** Valid CL source must exist or the results are unpredictable.
** Continuation records are supported. Either the command or
keyword can be split over two lines and do not have to be in
the first record.
** The maximum size source statement that can be processed (with
continuation lines) is approximately 5000 bytes.
SCNCMDKWD escape messages you can monitor for
TAA9893 No source files exist in the named libraries
TAA9894 The source file named does not exist
TAA9895 No source member found to match SRCMBR parameter
Escape messages from based on functions will be re-sent.
Command parameters *CMD
CMD The command to be scanned for.
KWD The keyword to be scanned for when used with the
FSTCHAR The first character of the parameter value for the
scan. *NONE is the default meaning that only the
command and keyword are scanned for. The first
character of the parameter value is ignored (it
could be a variable, a special value, or a
*VAR may be entered to include an & in the scan
meaning you only want the situations where a
variable is used. For example, if you want to scan
for a variable on a JOB keyword such as JOB(&xxx).
*SPC may be entered to include an * in the scan
meaning you only want the situations where a special
value is used. For example, if you want to scan for
a special value on a JOB keyword such as JOB(*JOBD).
*CONS may be entered to include a constant (a value
other than & or *) as the first character. For
example, if you want to scan for a constant on a JOB
keyword such as JOB(ABC).
USAGE Whether to list those commands with the keyword,
without the keyword, or both.
*YES is the default to list only those commands that
have the keyword.
*NO may be specified to list only those commands
that do not have the keyword.
*BOTH may be specified to list the command
regardless of whether the keyword is specified.
LIB Specifies 1 to 26 libraries to be searched.
The special value *USRLIBL may be used to describe
the user libraries on the current library list. The
current library is also considered to be part of
The special value *ALL may be used to mean all
libraries. You must have *USE authority to the
TAACVTLIBD authorization list to use *ALL.
The special value *ALLUSR2 may be used to mean all
normal user libraries. This includes all libraries
that do not begin with the letter Q plus the QGPL
library and excludes the S/36 libraries #LIBRARY,
#CGULIB, #COBLIB, #DFULIB, #RPGLIB, #SDALIB,
#SEULIB, and #DSULIB. You must have *USE authority
to the TAACVTLIBD authorization list to use
The special value *ALLNONQ may be used to mean all
libraries that begin with a letter other than Q.
You must have *USE authority to the TAACVTLIBD
authorization list to use *ALLNONQ.
SRCFILE The source file name to be scanned. The default is
*ALL for all source files in the libraries that are
selected. When searching for critical keyword use,
using *ALL is recommended as CL types may be
misplaced and not in the normal source files
If a name is entered (such as QCLSRC), only that
source file is searched in the selected libraries.
SRCMBR The source member name to be scanned.
*ALL is the default for all member names.
A specific member or a generic member name may be
OMITLIB A list of up to 40 libraries to be omitted if *ALL,
*ALLNONQ, or *ALLUSR2 are specified for LIB.
OMITLIB(*NONE) must be specified if a specific
library or libraries are named for the LIB
See the Considerations section.
The following TAA Tools must be on your system:
CHKALLOBJ Check *ALLOBJ special authority
EXTLST2 Extract list 2
RTVSYSVAL3 Retrieve system value 3
SNDCOMPMSG Send completion message
SNDJLGMSG Send job log message
SNDSTSMSG Send status message
None, the tool is ready to use.
Objects used by the tool
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
SCNCMDKWD *CMD TAACMEI QATTCMD
TAACMEIC *PGM CLP TAACMEIC QATTCL
TAACMEIC11 *PGM CLP TAACMEIC11 QATTCL
TAACMEIC12 *PGM CLP TAACMEIC12 QATTCL
TAACMEIC13 *PGM CLP TAACMEIC13 QATTCL
TAACMEIR12 *PGM RPG TAACMEIR12 QATTRPG
TAACMEIC CL pgm - Does CVTLIBDBF for source files
TAACMEIC11 CL pgm - Does CVTMBRLST for source
TAACMEIC13 CL pgm - Reads MBRLSTP file for no member
TAACMEIC12 CL pgm - Checks CVTLIBDBF file for CL types
TAACMEIR12 RPG pgm - Scans the source and prints