Command reference / db
FNDSTRPDM
Find String Using PDM
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.
Allowed environments: *ALL.
Positional parameters: 4.
Parameters
STRING
Find '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.
FILE
File
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: name- Specify the name of the physical file that contains the members you want to search.
Qualifier 2: Library: name- Specify the name of the library to be searched for the specified file.
*LIBL- All libraries in the job library list will be searched for the specified file.
*CURLIB- The current library for the job will be searched for the specified file. If no current library is defined, QGPL is used as the current library.
Qualified parts (object, then library; write LIBRARY/OBJECT)
File
File
Library
Library
Suggested / special values:
*LIBL, *CURLIB
MBR
Member
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 MBR parameter supports up to 300 values which can be a specific member name or a generic member name. If you need to specify more than 300 member names or you want to search members in multiple files or multiple libraries, you can use the Find String with List (FNDSTRPDM2) command. The FNDSTRPDM2 command allows you to define a search list file and member where each record contains the name of the library, file, and member to be searched.
Suggested / special values:
*ALL
*ALL- Search all the file members for the specified string.
name- Specify the name of the member to be searched.
generic-name- Specify the generic name of the file members to be searched. The generic name can be in one of the following formats: ABC* Searches all members with names that begin with the characters ABC. For example, ABC, ABCD, or ABCTEST. *ABC Searches all members with names that end with the characters ABC. For example, ABC, DABC, or TESTABC. *B* Searches all members that have the character B anywhere in the member name. For example, B, BALL, ABCD. A*C Searches all members that begin with the character A and end with the character C. For example, AC, ABC, or AZZZC. "a*" Searches all members with quoted names that start with the letter a . For example, "a", "aB", "aD". **ALL Searches all members with names ending with ALL. For example, ALL, BALL, or TESTALL. The double asterisk is needed in this case, since *ALL is defined as the special value to search all members of the file.
OPTION
Operation to perform
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. Source physical file member list options Data physical file member list options User-defined member list option 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.
*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.
*EDIT- Edit one or more members using the SEU (source entry utility) editor.
Element 1: Option: *CHGT- Change some of the attributes of one or more members. Change some of the attributes of one or more members in a physical file.
*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.
Element 1: Option: *CMPR- Compare one or more members.
Element 1: Option: *COPY- Copy one or more members to one or more new members. You can also copy members to another file, another library, or both.
Element 1: Option: *DLT- Delete one or more members from the file.
Element 1: Option: *DSP- Display one or more members using SEU (source entry utility). Display one or more members.
Element 1: Option: *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).
Element 1: Option: *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.
Element 1: Option: *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.
*DFU- Call DFU (data file utility) to change the chosen members.
character-value- Specify the name of an option you have defined in your active option file.
*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.
Elements in order
Option
Option
Suggested / special values:
*NONE, *EDIT, *CHGT, *CMPL, *CMPR, *COPY, *DFU, *DLT, *DSP, *DSPD, *MOD, *MRG, *PRT, *RNM, *RUNP, *SAVE, *SDA, *RLU
Prompt
Prompt
Allowed values:
*NOPROMPT, *PROMPT
COL
Columns to search
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.
1- Searching will start in column 1 of each record.
Element 1: From column: *RCDLEN- Only the last column of each record will be searched.
Element 1: From column: 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.
Element 2: To column: number- Specify the last column of the part of each record to be searched.
Elements in order
From column
From column
Suggested / special values:
*RCDLEN
To column
To column
Suggested / special values:
*RCDLEN
CASE
Kind of match
Specifies whether the search is case sensitive.
Allowed values:
*IGNORE, *MATCH
*IGNORE- Search the member for the specified string without case sensitivity.
*MATCH- Search for an exact match to the specified string.
PRTMBRLIST
Print list
Specified whether the list of those members for which a match is found is to be printed.
Allowed values:
*NO, *YES
*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.
PRTRCDS
Print records
Specifies which records that contains the string are to be printed. 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 (*). You can specify whether the record will be folded or truncated if it is greater than the length of the print line.
Suggested / special values:
*NONE
*NONE- Do not print any of the records that contain the specified string.
*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.
*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.
*MARK- Mark the occurrence of the string in the record.
*NOMARK- Do not mark the occurence of the string in the record.
*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.
Elements in order
Number to find
Number to find
Suggested / special values:
*ALL
Print format
Print format
Allowed values:
*CHAR, *HEX, *ALTHEX
Mark record
Mark record
Allowed values:
*MARK, *NOMARK
Record overflow
Record overflow
Allowed values:
*FOLD, *TRUNCATE
PARM
Parameters
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.
Examples
FNDSTRPDM STRING('Ms') FILE(*LIBL/CUST) MBR('NEW') CASE(*MATCH) OPTION(*NONE) PRTRCDS(*ALL *CHAR)
Find String Occurrences in One Member. 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.
FNDSTRPDM STRING('*TEST*') FILE(MYLIB/MYFILE) MBR('*APP') CASE(*IGNORE) OPTION(FIX)
Find String in a Set of Members. 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.
Generated from os/cl/catalog/FNDSTRPDM.json and os/cl/help/FNDSTRPDM.json.