TechTalk: Scanning with PDM

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: