?
Solved

search as400 source code

Posted on 2009-05-04
3
Medium Priority
?
922 Views
Last Modified: 2012-05-06
Is there a way to search all AS/400 source code to find a file, command, or comment within source code without having to open each individual source code?  

If I change a file I don't know what other programs this affects.
0
Comment
Question by:CompTech810
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Accepted Solution

by:
Dave Ford earned 2000 total points
ID: 24298516

Assuming your library is called MYLIB and the source physical file is QRPGLESRC, then the following command will search for any occurence of "stufftofind"

HTH,
DaveSlash


FNDSTRPDM STRING(stufftofind)
          FILE(MYLIB/QRPGLESRC)
          MBR(*ALL)
          OPTION(*DSP)

Open in new window

0
 
LVL 2

Author Closing Comment

by:CompTech810
ID: 31577709
Thanks for the quick response!!
0
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 24298898
If you have an old copy of the QUSRTOOL lib, there is a tool you can build called SCNALLSRC that does the trick.

FNDSTRPDM command can help (assumes you have the IBM PDM product), but it doesn't do a global search.

Third-party tools (my favorite is Hawkeye's Pathfinder) are the best way to cross-reference your programs, since there are lots of complexities that simple scans can't resolve (program or file name passed as a parameter, just for example).

Another alternative is to use the GREP command from the Qshell environment (QSH).   Grep can be tricky if you haven't used it before.

I use a simple technique on machines that don't have a cross-reference too installed, sometimes:

  • Use the DSPFD command (repeatedly if needed) to dump a list of all the source files that you are interested in to an output file (note, QAFDPHY field PHDTAT contains an "S" if a file is a source physical file.
  • Write a little CL that reads the output file, and runs you favorite FNDSTRPDM over each source file (ignore data files if they are in the list).
- Gary Patterson

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
The well known Cerber ransomware continues to spread this summer through spear phishing email campaigns targeting enterprises. Learn how it easily bypasses traditional defenses - and what you can do to protect your data.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question