× 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.




Source is gone, I have the spool file and am copying the code now, but is there 
any way to get the source from the object?

Ron Power


Ron,

I once wrote a program to pull the code from the compile listing for a colleague, but I don't have the code anymore. That seems to me much easier and quicker than going for 3rd party de-compilers (which can still come in handy, and I have used RTVCLSRC lots..)

If it is one compile with one source member (/COPY can complicate it), and even if not, there is a way, with the spool file. This suggestion loses the dates and sequence numbers on the lines. That's doable too, from the source, but a little more complicated.

=> First CRTPF with spaces wide enough to hold the print lines.

=> Then  use CPYSPLF to get the compile listing into a physical file.

=> Use CRTPF RCDLEN(100), or whatever the length of your SRCDTA.

=> Use SQL and selection criteria to DELETE the page headers and other repeated lines that do not consitute source. Don't get intimated, there's not so much to be insurmountable. <g> Just looks scary. <g>

__ For example:

Delete from FlatFile where rrn( FlatFile ) < 999 { where 999 is the first line of the code list. }

Delete from FLATFILE where RRN( FLATFILE ) > 99999 {--where 99999 is the record number in the copied file of the last line of the source code list---}

Delete from FLATFILE where substr( flatfile, 35, 11 ) = 'IBM ILE RPG'
or flatfile like '%Source Specifications%'
or flatfile like '%....1....+%'


There will be other lines generated in the compile, not so bad to go through in blocks and a lot easier than retyping, and less prone to typos. The compile listing I'm looking at has the seq-nbr ending in print position 6, with the form type in print position 8.. So use SQL to copy to another physical file

=> insert into flatfile_2 select ' ' substr( flatfile, 8, 105 ) from flatfile.

Okay, if you have indented source for structured op codes, I would write some kind of RPG to the copy. Not so bad. <g>

Sounds like a fun exercise.

- Alan



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.