There are a couple of ways to search through source code for information you are looking for (ie. program names, files, attributes, etc.). The 1st way is to do a search on a single or multi-program file level through the work with members option, in which you search only specific program(s) for your information. The other way is to do a search through an entire object such as QRPGLESRC or QDDSSRC.
In using the 1st method, start the Program Development Manager (STRPDM), and use option 3 to 'Work with members'.
You will see this screen pop up.
AS/400 Programming Development Manager (PDM) Select one of the following: 1. Work with libraries 2. Work with objects 3. Work with members 4. Work with projects 5. Work with groups 6. Work with parts 9. Work with user-defined options Selection or command F3=Exit F4=Prompt F9=Retrieve F10=Command entry F12=Cancel F18=Change defaultsNow type in the needed information for the file and library to which you want to conduct the search.
Specify Members to Work With Type choices, press Enter. File . . . . . . . . . . QRPGLESRC Name, F4 for list Library . . . . . . . . USER999 *LIBL, *CURLIB, name Member: Name . . . . . . . . . *ALL *ALL, name, *generic* Type . . . . . . . . . *ALL *ALL, type, *generic*, *BLANKFrom here, type in 25 in the Opt space of the Member you would like to do the search on. If you would like to check all the programs listed on this members screen, simple hit F13 (Shift F1) and you will see that 25 is filled in on all the options.
Work with Members Using PDM S103C160 File . . . . . . QRPGLESRC Library . . . . USER999 Position to . . . . . Type options, press Enter. 2=Edit 3=Copy 4=Delete 5=Display 6=Print 7=Rename 8=Display description 9=Save 13=Change text 14=Compile 15=Create module.. Opt Member Type Text 25 ABC101 RPGLE Add all ABC customers 25 ABC102 RPGLE Add CSBTN to customer file 25 ABC400 RPGLE SUBFILE for ABC pgm 25 SAM001 RPGLE Parse leads for Sample pgm 25 SAM002 RPGLE 1 time program to populate ADDR field 25 SAM003 RPGLE Subfile maintenance for Sample pgm Leads 25 SAM004 RPGLE Dup check leads Sample pgm More... Parameters or command ===> F3=Exit F4=Prompt F5=Refresh F6=Create F9=Retrieve F10=Command entry F23=More options F24=More keysNow hit Enter, and you will see the Find String screen. In the blank to the right of "Find", type in the information you are seeking and press enter. In this example we are looking for all the programs that use the Physical File ABP001.
Find String Type choices, press Enter. Find . . . . . . . . . . . . . . ABP001___________________ From column number . . . . . . 1 1 - *RCDLEN To column number . . . . . . . *RCDLEN 1 - *RCDLEN Kind of match . . . . . . . . 2 1=Same case, 2=Ignore case Option . . . . . . . . . . . . . 2 *NONE, Valid option Prompt . . . . . . . . . . . . N Y=Yes, N=No Print list . . . . . . . . . . . N Y=Yes, N=No Print records . . . . . . . . . N Y=Yes, N=No Number to find . . . . . . . . *ALL *ALL, number Print format . . . . . . . . . *CHAR *CHAR, *HEX, *ALTHEX Mark record . . . . . . . . . Y Y=Yes, N=No Record overflow . . . . . . . 1 1=Fold, 2=Truncate Find string in batch . . . . . . N Y=Yes, N=No Parameters . . . . . . . . . . . F3=Exit F5=Refresh F12=Cancel F16=User options F18=Change defaultsYou can see now that the search found the PF in program ABC102. Hit Enter to continue the search, and it will look through all the files you have chosen and will pop up the screen when it finds the PF once again.
Columns . . . : 6 76 Edit USER999/QRPGLESRC SEU==> ABC102 FMT FX FFilename++IPEASF.....L.....A.Device+.Keywords+++++++++++++++++++++++++ *************** Beginning of data ************************************* 0001.00 FABP001 IF E DISK 0002.00 FBT O E DISK 0003.00 *--------------------------------------------------------------------- 0004.00 C DoW *In90 = *Off 0005.00 C Read ABD001 90 0006.00 C If *In90 = *Off and 0007.00 C ABCRNTO = *Zero and 0008.00 C ABBTN > 2000000000 0009.00 C Eval BTBTN = CSBTN 0010.00 C Write ABDREC 0011.00 C EndIf 0012.00 C EndDo 0013.00 C Eval *Inlr = *On 0014.00 C Return 0015.00 *--------------------------------------------------------------------- 0016.00 *--------------------------------------------------------------------- F3=Exit F4=Prompt F5=Refresh F9=Retrieve F10=Cursor F11=Toggle F16=Repeat find F17=Repeat change F24=More keysAnother method to conduct the search is through Option 2 of the PDM. Here is where you work with objects. Once again, type in your Library name, and for Object name, type in Q*. This will list all of the Q objects, such as QDDSSRC, QRPGSRC, etc...
Specify Objects to Work With Type choices, press Enter. Library . . . . . . . . . . USER999 *CURLIB, name Object: Name . . . . . . . . . . . Q* *ALL, name, *generic* Type . . . . . . . . . . . *ALL *ALL, *type Attribute . . . . . . . . *ALL *ALL, attribute, *generic*, *BLANKThe next screen you see will contain the specified objects. Now all you need to do is type in 25 in the object you want to do the search in, and it will search through all files/programs associated with that object.
Work with Objects Using PDM S103C160 Library . . . . . USER999 Position to . . . . . . . . Position to type . . . . . Type options, press Enter. 2=Change 3=Copy 4=Delete 5=Display 7=Rename 8=Display description 9=Save 10=Restore 11=Move ... Opt Object Type Attribute Text __ QCLSRC *FILE PF-SRC __ QCMDSRC *FILE PF-SRC __ QDDSSRC *FILE PF-SRC 25 QRPGLESRC *FILE PF-SRC __ QRPGSRC *FILE PF-SRC Bottom Parameters or command ===> F3=Exit F4=Prompt F5=Refresh F6=Create F9=Retrieve F10=Command entry F23=More options F24=More keysNow hit Enter, and the search will begin through all the members associated with the object you have chosen to search. You will notice the same result as above was located in the search.
So there you have it, 2 different ways of conducting a search for information using Option 25 in PDM.