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



"COBOL400-L" <cobol400-l-bounces@xxxxxxxxxxxx> wrote on 11/17/2016
01:00:31 PM:
----- Message from "Stone, Joel" <Joel.Stone@xxxxxxxxxx> on Thu, 17
Nov 2016 17:53:20 +0000 -----

To:

"'COBOL Programming on the IBM i (AS/400 and iSeries)'" <cobol400-
l@xxxxxxxxxxxx>

Subject:

[COBOL400-L] can COPY ... REPLACING replace colhdg and text and
alias verbiage when it gets field info from a referenced field?

I cant get it to work. Is this possible???

Thanks in advance.



Unfortunately, no. Here's the description of the replacing phrase from the
manual:

Pseudo-text-1 must contain, as a minimum, a text word. Since text words,
by
definition, are bounded by separators, pseudo-text cannot be used to
select
part of a word for replacement (for example, a prefix in a data name): a
complete text word must be used in order to find a match. It is possible,
however, to simulate the partial replacement of a text word held in the
library
text, by dividing it into two or more text words using separators that are
used
only for matching purposes, and not copied into the source program. For an
example of this method, refer to “Coding Examples” on page 607.

If your ALIAS name had something else as a text separator, it could do it.
But then it wouldn't be valid in it's un-replaced state--at least not for
DDS. If you wanted to use an actual source copy member, you could. But the
inconvenience of maintaining the copy members to use for data definition
and specifying the replacing phrase everywhere you use it wouldn't be
worth the effort--at least not to my mind.

I've often wanted to do this, too. You could try an RFE, but COBOL RFEs
generally don't get much traction.

Michael Quigley
Computer Services
The Way International
www.TheWay.org

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.