× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 7/3/2023 2:10 PM, joe wrote:
The same exactly I was looking for:-

"This single member holds every line of source code on the entire system.
Every library.
Every source file.
Every member."

"One table, one member, several million lines of source code."

I've certainly never done this, so I don't have code I can share.
Seriously consider Jim's advice and move the source to the IFS.
Perhaps grep will help you search/filter better than the native source files.

I would not recommend copying all of your source into a single member. None of the native tools will work that way - you can't edit or compile with all of the source blended together like that.

However, you might consider an index that you maintain separately. I don't mean SQL CREATE INDEX, rather I mean a set of tables that would allow you to search across the existing QxyzSRC file members. I don't have code to share.

Imagine two tables. The first table holds columns that you see in DSPFD. Source file name, Source library name, Source member name, Source type, Source text, maybe last changed date, and a generated integer key that makes each record unique. There would be one record for every separate source member on the system.

The second file is the source, or perhaps on;y the parts of the source you want to be able to search. The columns might be the integer key, the sequence number, and the source line.

Imagine a source member like
LIB1/QCLSRC.CLTEST type(CLP) text('Test CL CALL command')
pgm
call pgm2
endpgm

The 'master' table might have these
LIB1 QCLSRC CLTEST CLP Test CALL command 0000000001

The 'source' table might have these
0000000001 000001 pgm
0000000001 000002 call pgm2
0000000001 000003 endpgm

Now you can use SQL to search by JOINing source and master.

You, of course, need to write all of the code that creates and maintains these two tables. I would approach this by starting with a single source member. Write a CL program that does an OVRDBF to point you to the proper member, and then write an RPG program that reads the INFDS to know what file and member are being opened. Write the 'master' record, then read the source lines and write the 'source' records.

Good luck!



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.