Solved

search as400 source code

Posted on 2009-05-04
3
905 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 500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
Configuring Remote Assistance for use with SCCM
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

732 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