Perhaps you have discovered PDM option 25, which lets you find a string in a file, and have wondered if you can perform the scanning process without having to go through the PDM displays.
If you have Release 3.0 installed, there is a way. Simply run the Find String with PDM (FNDSTRPDM) command. When you prompt this command you will see that you have much more flexibility than you get when you use option 25. For instance, you can indicate that all members be scanned, or provide generic member names (having the asterisk at either or both ends, or in the middle).
For instance, suppose you have just inserted a field in database file FILEA and consequently need to change all the RPG programs that use that file. Nothing could be simpler:
FNDSTRPDM STRING('FILEA') + FILE(MYLIB/QRPGSRC) + MBR(*ALL) + OPTION(*CMPL) + COL(7 11) + PRTMBRLIST(*YES) + PARM('REPLACE(*YES)')
This command will scan for string 'FILEA' in file MYLIB/QRPGSRC in all members. The search is to be made between columns 7 and 11. When found, the system will automatically compile it with REPLACE(*YES), and at the same time will print a list of all the members where 'FILEA' was found.
Now get this: you can submit this command to batch processing, by simply including that command string in the SBMJOB command!
This is a powerful command that will no doubt make your programmers' lives easier, but there is a little problem in the documentation. Although the help text and the PDM manual claim that the MBR parameter can have all sorts of wonderful generic names (X*, *X, *X*, X*Y), only the "X*" format actually works; the others require you to enclose the generic name in single quotes, or you will simply get message PDM0577, "No members match the generic member name ___ in file ___ in library ___." This requirement for the single quotes is not indicated.
Midrange Computing
LATEST COMMENTS
MC Press Online