Solved

search as400 source code

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Catalog Index 9 123
Iseries Object Security 5 82
Comments on the use of ftp server/client on OS/400 AS/400 4 111
Secure coding guides/standards for Cobol programming 10 366
Starting your own business is always a daunting process, and for most people it is brand new experience. Avoid the common pitfalls by following these tips to start on the road to success.
There's a lot of hype surrounding blockchain technology. Here's how it works and some of the novel ways it' s now being used - including for data protection.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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