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



>
> We are trying to search through all our program source members looking
> for a specific file, and if found, insert a line of source via an RPGLE
> program.  When writing the new line of source, we set the sequence
> number (SRCSEQ)to be between the two lines where we want to add the new
> line.

The sequence numbers don't really mean anything.  They're just stored in
the record so that it can "remember" them for the next time you use SEU.

> When the program ends and we look at the source via SEU, the new
> lines are always at the end.  The system automagically resets the
> sequence # of the new lines.  How do we get around this?

Write the records to the member in the order in which you'd like them
to appear.

While you're reading the member (you must be reading it in order to
search it, right?) write each record to a work space of some type (you can
use an array, a work file, a user space, whatever you like)

When you find the line where you need to insert another line, write that
extra line to the work space.

Once you've written the whole member to the work space, and inserted the
appropriate new source lines, CLRPFM the original member, and copy the
data back.

Or -- if you prefer -- use CPYF to put them back.

Either way, be careful.  Back up the file before you try running your
program the first time :)



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.