Solved

search as400 source code

Posted on 2009-05-04
3
884 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
Comment Utility

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
Comment Utility
Thanks for the quick response!!
0
 
LVL 34

Expert Comment

by:Gary Patterson
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now