The Scan Data Base Field 2 command is intended for name and address
data base files when some pieces of a name and address are known but
not all. SCNDBFFLD2 scans up to 5 character fields for up to 5 15
byte strings each. For example, if you know a string of letters from
a name and a few from the address, SCNDBFFLD2 can help find the
Assume you are trying to read a hand written name and identify the
account number of a customer. You know that the name contains the
string of letters 'def' and the letter 'w'. You could scan all of
the records for this string in the NAME field with:
SCNDBFFLD2 FILE(xxx) FLDSCN((NAME (DEF W))
Since the default for IDFLD is *PROMPT, a list of fields in the file
format would be displayed. Place an 'X' in up to 3 fields to help
you identify any records that will be found such as an 'account
number'. When the Enter key is pressed, the display re-appears with
sequence values ('010', '020', '030') at the top of the display for
the fields you selected. You may rearrange the ID fields by entering
a different sequence number. When the Enter key is pressed after no
more changes in the ID fields, the scan will occur.
Both the scan values and the data in the field to be scanned are
folded to upper case before scanning.
A listing would be displayed of any records that matched the scan
value specified. If the scan is successful, the listing will include
the first 50 bytes of the field data. Each scan value specified is
listed on a separate line.
Assume you know that a name field contains a string of letters 'or'
and 'er', the address field contains '372'and 'way', and the state is
IL (for Illinois). You could issue the following command:
SCNDBFFLD2 FILE(xxx) FLDSCN((NAME (OR ER))
(ADDR(372 WAY)) (STATE(IL))
To appear in the listing, a record must contain all of the scan
SCNDBFFLD2 escape messages you can monitor for
TAA9892 No scan values were found
Escape messages from based on functions will be re-sent.
SCNDBFFLD2 Command parameters *CMD
FILE The qualified name of the file to be scanned. The
library value defaults to *LIBL. A specific library
or *CURLIB may also be used.
The record length may not exceed 9999.
FLDSCN A list of up to 5 field names in the file to be
scanned. Each field name may be scanned for 5
values. All scan values in all fields must be found
for the record to be listed. Each field to be
scanned is a two part parameter.
The first part is the field name. Only character
fields (Type = A) may be scanned. The field length
may not exceed 500 bytes.
The second part is a list of up to 5 scan values of
15 bytes each. Both the scan value and the data to
be scanned are folded to upper case before scanning.
Any character may be entered as well as digits.
Embedded blanks are valid such as 'John Doe'. You
cannot scan for a trailing blank as the value will
be trimmed to the last non-blank
IDFLD A list of up to 3 ID fields that may be used to help
identify any records where the scan values are
found. If you have a unique key to the file, the
unique key fields could be specified to help
identify the record.
The default is *PROMPT in which case a subfile is
displayed of all the fields in the file and a
selection may be made. A typical solution is to
enter an 'X' to select the fields needed to identify
the record (up to 3 fields may be selected). When
Enter is pressed, the display is refreshed with the
selected fields at the top and a sequence number
assigned. When Enter is pressed again with no
changes, the command begins operation.
Only the first 15 positions of the ID field will be
listed. If a decimal field is used, it must be 15
digits or less.
MBR The member of the file to be used. *FIRST is the
default. A specific name or *LAST may be specified.
OUTPUT How to output the results. * is the default to
display the spooled file if the command is entered
interactively. If the display is ended with F3/F12
or the Enter key, the spooled file is deleted after
it is displayed. To retain the spooled file, you
may use the the System Request 'Cancel' function and
the spooled file will exist in a HLD status.
If the command is entered in batch or *PRINT is
specified, the spooled file is output and retained.
The record length may not exceed 9999 bytes.
The field to be scanned must be a character type and may not exceed
The following TAA Tools must be on your system:
CHKDBFMBR Check data base file member
EDTVAR Edit variable
EXTLST Extract list
EXTLST2 Extract list 2
FILEFDBCK File feed back
HLRMVMSG HLL Remove message
PMTFLD Prompt field
RSNLSTMSG Resend last message
RTVDBFA Retrieve data base file attributes
RTVFLDARR Retrieve field array
RTVFLDA Retrieve field attributes
RTVSYSVAL3 Retrieve system value 3
SCNVARRGT Scan variable right
SNDCOMPMSG Send completion message
SNDESCINF Send escape information
SNDESCMSG Send escape message
SNDSTSCNT Send status count message
SNDSTSMSG Send status message
None, the tool is ready to use.
Objects used by the tool
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
SCNDBFFLD2 *CMD TAADBNI QATTCMD
TAADBNIC *PGM CLP TAADBNIC QATTCL
TAADBNIR *PGM RPG TAADBNIR QATTRPG