Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Find String Using PDM (FNDSTRPDM) command allows you to search for character or hexadecimal strings in source physical file members or data physical file members. You can use any Programming Development Manager (PDM) option or one of your own user-defined options on each member that contains a match for the string.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
STRING | Find 'string' | Character value | Required, Positional 1 |
FILE | File | Qualified object name | Required, Positional 2 |
Qualifier 1: File | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
MBR | Member | Values (up to 300 repetitions): Character value, *ALL | Required, Positional 3 |
OPTION | Operation to perform | Element list | Required, Positional 4 |
Element 1: Option | Character value, *EDIT, *COPY, *DLT, *DSP, *PRT, *RNM, *DSPD, *SAVE, *CHGT, *CMPR, *CMPL, *MOD, *MRG, *RUNP, *SDA, *DFU, *RLU, *NONE | ||
Element 2: Prompt | *NOPROMPT, *PROMPT | ||
COL | Columns to search | Element list | Optional |
Element 1: From column | Character value, 1, *RCDLEN | ||
Element 2: To column | Character value, *RCDLEN | ||
CASE | Kind of match | *IGNORE, *MATCH | Optional |
PRTMBRLIST | Print list | *NO, *YES | Optional |
PRTRCDS | Print records | Single values: *NONE Other values: Element list |
Optional |
Element 1: Number to find | Character value, ' ', *ALL | ||
Element 2: Print format | *CHAR, *HEX, *ALTHEX | ||
Element 3: Mark record | *MARK, *NOMARK | ||
Element 4: Record overflow | *FOLD, *TRUNCATE | ||
PARM | Parameters | Character value | Optional |
Top |
Specifies the string you want to search for
This is a required parameter.
Top |
Specifies the file that contains the members you want to search. The file to be searched can be a source physical file or a data physical file.
This is a required parameter.
Qualifier 1: File
Qualifier 2: Library
Top |
Specifies the member or members to be searched. You can use this parameter to search all the members or a subset of members in the specified file.
This is a required parameter.
You can specify 300 values for this parameter.
The generic name can be in one of the following formats:
Top |
Specifies the Programming Development Manager (PDM) option that you want performed on each member for which a match for the string is found. The parameter is comprised of two elements, one for choosing an option and one for prompting. The option can be any PDM option that is valid for this type of file, or any user-defined option in your active option file. The valid options differ for source physical files and data physical files.
This is a required parameter.
Element 1: Option
Source physical file member list options
The following member types can be compiled: BAS, BAS36, BAS38, C, CBL, CBLLE, CBL36, CBL38, CICSC, CICSCBL, CICSSQLCBL,CLD, CLLE, CLP, CLP38, CMD, CMD38, CPP, DSPF, DSPF36, DSPF38, FTN, ICFF, LF, LF38, MENU, PAS, PF, PF38, PLI, PLI38, PNLGRP, PRTF, PRINT38, QRY38, RMC, RPG, RPGLE, RPG36, RPG38, RPT, RPT36, RPT38, SPADCT, SQLC, SQLCPP, SQLCBL, SQLCBLLE, SQLFTN, SQLPLI, SQLRPG, SQLRPGLE, and TBL.
When the programming development manager compiles a program using the necessary create commands, the object name to create is always specified as the source member name. You may change the object name parameter to another object name by prompting the option or typing the correct parameter on the command line. The programming development manager will check if the object name already exists, and if it does, the Confirm Compile of Member display appears. This display gives you the option of deleting the existing object.
Note: This screen will not appear if the Replace object prompt on the Change Defaults display (or CHGPDMDFT command) is set to Y (or *YES).
If you have changed the object name parameter to a special value, PDM will not check to see if the object exists. For example, if you compile an RPG program and change the Program prompt to *CTLSPEC, the programming development manager will not check if the object exists.
Data physical file member list options
User-defined member list option
Element 2: Prompt
The prompt portion of this parameter specifies whether or not you want to be prompted each time the command for the option is carried out.
Top |
Specify the starting and ending column numbers of the part of each file record to be searched. This allows you to search the beginning, ending, or middle of each record.
The starting column number cannot exceed the record length.
Element 1: From column
Element 2: To column
Top |
Specifies whether the search is case sensitive.
Top |
Specified whether the list of those members for which a match is found is to be printed.
Top |
Specifies which records that contains the string are to be printed.
Single values
Element 1: Number to find
Element 2: Print format
Element 3: Mark record
You can mark the string on the printed record. The string itself is used as a marker for character searches for quick recognition. For hexadecimal searches, the string is marked with asterisks (*).
Element 4: Record overflow
You can specify whether the record will be folded or truncated if it is greater than the length of the print line.
Top |
Specifies the parameters that you want to be added to the command carried out as a result of the value specified for element 1 of the Operation to perform (OPTION) parameter.
Top |
Example 1: Find String Occurrences in One Member
FNDSTRPDM STRING('Ms') FILE(*LIBL/CUST) MBR('NEW') CASE(*MATCH) OPTION(*NONE) PRTRCDS(*ALL *CHAR)
This command finds all records of member NEW in file CUST that contain the string Ms. The file will be located using the job list list. The search will be case sensitive. A spooled file is generated that lists each record that contains the search string.
Example 2: Find String in a Set of Members
FNDSTRPDM STRING('*TEST*') FILE(MYLIB/MYFILE) MBR('*APP') CASE(*IGNORE) OPTION(FIX)
This command finds occurrences of the string *TEST* in members of file MYFILE in library MYLIB with member names that end with the letters APP. The search is not case sensitive so records with *test* or *Test* will be considered as matching the search string. For each member that contains the search string, user-defined option FIX will be run from the active option file.
Top |
Top |