Solved

search as400 source code

Posted on 2009-05-04
3
896 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
3 Comments
 
LVL 18

Accepted Solution

by:
daveslash 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 34

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

How do we balance the user experience (UX) with reasonable security measures? It can be done, if you keep these fundamentals in mind.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

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