Find String with List (FNDSTRPDM2)
Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Find String with List (FNDSTRPDM2) command allows you to search for character or hexadecimal strings in source physical file members or data physical file members using a search list in a physical source file member.
Top |
Parameters
Keyword | Description | Choices | Notes |
---|---|---|---|
STRING | Find 'string' | Character value | Required, Positional 1 |
FILE | File | Qualified object name | Optional, Positional 2 |
Qualifier 1: File | Name, QAUOSR2 | ||
Qualifier 2: Library | Name, QPDA | ||
MBR | Member | Name, QAUOMB2 | Optional, Positional 3 |
OPTION | Operation to perform | Element list | Optional, 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 ', *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 |
Find 'string' (STRING)
Specifies the string you want to search for
This is a required parameter.
- character-value
- Specify the string to search for, enclosed in single quotation marks. The string can be character or hexadecimal.
Top |
File (FILE)
Specifies the physical source file that contains the member which contains the search list.
Qualifier 1: File
- QAUOSR2
- The member that contains the search list is in physical file QAUOSR2.
- name
- Specify the name of the physical source file that contains the member that contains the search list.
Qualifier 2: Library
- QPDA
- The file that contains the search list member is in library QPDA.
- name
- Specify the name of the library to be searched for the specified file.
Top |
Member (MBR)
Specifies the file member that contains the search list.
- QAUOMB2
- Member QAUOMB2 contains the search list.
- name
- Specify the name of the member that contains the search list.
Specifies the search arguments in the search list.
- #lib
- Library name in position 1 to 10 under the header #lib.
- #file
- File name in position 12 to 21 under the header #file.
- #member
- Member name in position 23 to 32 under the header #member. Generic names *all for all members or ABC* with names that begin with the character ABC can be used
Top |
Operation to perform (OPTION)
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
- *NONE
- No action is performed on the member that contains the string. Use this value when printing the list of members or records that contain the string.
Source physical file member list options
- *EDIT
- Edit one or more members using the SEU (source entry utility) editor.
- *CHGT
- Change some of the attributes of one or more members.
- *CMPL
- Compile one or more members. The system creates an object based on the member being compiled. The member is compiled interactively or in batch mode, depending on what you have specified on the Change Defaults display or the Change PDM Defaults (CHGPDMDFT) command.
The following member types can be compiled: BAS, BAS36, BAS38, C, CBL, CBLLE, CBL36, CBL38, CICSC, CICSCBL, CICSCBLLE, 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.
- *CMPR
- Compare one or more members.
- *COPY
- Copy one or more members to one or more new members. You can also copy members to another file, another library, or both.
- *DLT
- Delete one or more members from the file.
- *DSP
- Display one or more members using SEU (source entry utility).
- *DSPD
- Display information about one or more members.
- *MOD
- Create a module object for an ILE source type.
- *MRG
- Merge the target member with another member.
- *PRT
- Print one or more members using SEU (source entry utility).
- *RNM
- Rename one or more members.
- *RUNP
- Run a source member with a member type of REXX, OCL36, BASP, or BASP38. If you try to run a member with a type that cannot be run, you receive an error message. To run an OCL36 procedure, the file name must be QS36PRC. You can have the member run in batch mode or interactively depending on what you specified in the Run in batch prompt on the Change Defaults display or CHGPDMDFT command.
- *SAVE
- Save a member on diskette or tape.
- *SDA
- Use SDA (screen design aid) to work with the chosen members.
- If the member type is DSPF or DSPF38, SDA is called to work with a display.
- If the member type is MNU, MNUDDS or MNUCMD, SDA is called to work with a menu.
- If the member type is DSPF36 or MNU36, then the System 36 SDA main menu is displayed.
- If the former type of member MNU is entered, SDA converts this to MNUDDS.
- Note that menu members for PDM have type MNUDDS for the image member and type MNUCMD for the command source member. The two are linked together to constitute a group, so that specifying one of the types means that you also operate on the linked member at the same time.
- *RLU
- Use RLU (report layout utility) to work with the chosen members.
Data physical file member list options
- *CHGT
- Change some of the attributes of one or more members in a physical file.
- *CMPR
- Compare one or more members.
- *COPY
- Copy one or more members to one or more new members. You can also copy members to another file, another library, or both.
- *DFU
- Call DFU (data file utility) to change the chosen members.
- *DLT
- Delete one or more members from the file.
- *DSP
- Display one or more members.
- *DSPD
- Display information about one or more members.
- *RNM
- Rename one or more members.
- *SAVE
- Save a member on diskette or tape.
User-defined member list option
- character-value
- Specify the name of an option you have defined in your active option file.
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.
- *NOPROMPT
- Do not prompt for the command to be carried out for each member that matches the string.
- *PROMPT
- Prompt for the command to be carried out for each member that matches the string.
Top |
Columns to search (COL)
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
- 1
- Searching will start in column 1 of each record.
- *RCDLEN
- Only the last column of each record will be searched.
- number
- Specify the first column of the part of each record to be searched.
Element 2: To column
- *RCDLEN
- The part of each record to be searched extends from the specified starting column to the last column of the record.
- number
- Specify the last column of the part of each record to be searched.
Top |
Kind of match (CASE)
Specifies whether the search is case sensitive.
- *IGNORE
- Search the member for the specified string without case sensitivity.
- *MATCH
- Search for an exact match to the specified string.
Top |
Print list (PRTMBRLIST)
Specified whether the list of those members for which a match is found is to be printed.
- *NO
- Do not print the list of members that contain a match to the string.
- *YES
- Print the list of members that contain a match to the specified string.
Top |
Print records (PRTRCDS)
Specifies which records that contains the string are to be printed.
Single values
- *NONE
- Do not print any of the records that contain the specified string.
Element 1: Number to find
- *ALL
- Print all the records that contain the specified string.
- 1-99999
- Specify the number of records to be printed that contain the specified string.
Element 2: Print format
- *CHAR
- Print the records in character format.
- *HEX
- Print the records in hexadecimal, over/under style format. This means that the character value is printed with the hexadecimal below it.
- *ALTHEX
- Print the records in hexadecimal side-by-side style 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 (*).
- *MARK
- Mark the occurrence of the string in the record.
- *NOMARK
- Do not mark the occurence of the string in the record.
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.
- *FOLD
- Print the entire record over multiple print lines.
- *TRUNCATE
- Print only the part of the record that fits on a single print line. When *ALTHEX is used, only columns 1 - 32 are printed, and when *CHAR or *HEX are used, columns 1 - 100 are printed.
Top |
Parameters (PARM)
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.
- character-value
- Specify the parameters to be passed to the command associated with the value specified for the OPTION parameter. The default for this parameter is blank which will pass no parameters.
Top |
Examples
FNDSTRPDM2 STRING('Ms') FILE(LIB1/MYFILE) MBR(SCHLIST) CASE(*MATCH) OPTION(*NONE) PRTMBRLIST(*YES)
This command finds occurrences of the string Ms in all file members in the search list. The search list is in member SCHLIST in file MYFILE in library LIB1. The search will be case sensitive. A spooled file is generated that lists the file members that contain at least one record that contains the search string.
Top |
Top |