The Scan Generic Source command scans generic members in a source
file, all source files in a library, or a subset of the source files
in a library. Up to 20 arguments may be scanned for. APIs are used
to access the source files and members. This allows a fast method of
finding all occurrences of up to 20 strings in multiple members.
An outfile is optional. If used, the model file is TAASRCFP with a
format name of SCNSRCR.
A typical command would be:
SCNGENSRC ARGUMENT(ABC) GENMBR(XXX)
By default, all source files would be searched for in the current
library. If no current library is assigned, the first library on the
user portion of the library list is used. Members with a generic
name of XXX would be found and scanned for the argument ABC.
The TAA Tool SCNSRC is used to perform the scan. A spooled file
would exist for each source file that contains one or more of the
generic members. The completion message states the number of files
and members searched and the number of members where the argument was
found.
There is a limit of 990 source files in a library and 900 members in
a file that match the generic name.
SCNGENSRC escape messages you can monitor for
----------------------------------------------
TAA9883 No members found with the generic name.
TAA9884 No members found with one of the arguments.
TAA9885 More than 900 generic members found.
TAA9886 More than 999 source files.
TAA9887 No source files in the library.
TAA9894 Data area not on library list.
Escape messages from system commands will be re-sent.
Contrast with SCNALLSRC
-----------------------
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.
Command parameters *CMD
------------------
ARGUMENT A list of up to 20 arguments to be scanned for. 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. If the source may contain lower
case, specify the TRANSLATE parameter.
GENNAME The generic name of the member to be scanned. If
the value does not contain an * at the end, generic
is assumed.
*ALL may be entered for scanning all members.
Scanning all members in a large file is not a good
performer and the limit of 900 source members may
prevent execution. You should consider either a
generic name or the use of SCNALLSRC.
Note that there is no method of specifying an
individual member unless there is only one matching
a generic name. (Use SCNSRC directly).
SRCFILE The source file to be scanned. The default is *ALL
meaning all source files found in the library.
*STD may be entered to mean all the system source
files defined in the help text for the system. For
a listing of these, use the PRTSRCTYP tool.
*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 returned.
See the discussion with the CRTSRCFLST tool.
*QATT may be entered to mean the source files used
by the TAA Productivity Tools. *QATT2 may be
entered to mean all the QATTxxx source file names
that exist in QUSRTOOL. Use the PRTQATTF command
for a list of the files.
LIB The library containing the source files. 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.
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 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.
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.
Restrictions
------------
A limit of 999 source files in a library may be processed.
A limit of 900 generic members in a file may be processed.
Prerequisites
-------------
The following TAA Tools must be on your system:
CHKGENERC Check generic
CHKOBJ3 Check object 3
EDTVAR Edit variable
EXTLST2 Extract list 2
RTVLIBSRCF Retrieve library source file
RTVMBRLST Retrieve member list
SCNSRC Scan source
SNDCOMPMSG Send completion message
SNDESCMSG Send escape message
SNDSTSMSG Send status message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
SCNGENSRC *CMD TAASRDU QATTCMD
TAASRDUC *PGM CLP TAASRDUC QATTCL
|