Nope, I think you are incorrect, at least according to the hp COBOL manual
and my trials...:

Example 2 [REV BEG] This example shows how the REPLACE statement can be used
to replace substrings. This is done by putting parentheses around the
substring to be copied and around pseudo-text-1. Assume the source program
contains the following text before the replacement:[REV END] 01
(FIRST)-RECORD PIC X(80). [REV BEG] After the following REPLACE
statement[REV END] REPLACE COPY-MODULE REPLACING ==(FIRST)== BY ==INPUT==.
the resultant text is: 01 INPUT-RECORD PIC X(80).
or, if you prefer:

http://www.docs.hp.com/cgi-bin/doc3k/B3150090013.11820/183

Iv'e tried other delimiters, but had no success...the parenteses work as
stated in the dicumentation.


Ray Shahan



> -----Original Message-----
> From: Doug Werth [SMTP:[log in to unmask]]
> Sent: Tuesday, March 26, 2002 1:13 PM
> To:   Shahan, Ray; [log in to unmask]
> Cc:   [log in to unmask]
> Subject:      Cobol COPY REPLACING (was: $Include vs. COPY)
>
> Ray Shahan <[log in to unmask]> writes:
> To: <[log in to unmask]>
> Sent: Tuesday, March 26, 2002 1:45 PM
> Subject: Re: $Include vs. COPY
>
>
> > You need to have '()' around the subject to replace.
> >
> >          01  ACTIVITY-RECORD.
> >              05  (AC)-VEH-OR-UNIT.
> >                  10  (AC)-UNIT-TYPE.
> >                      15  (AC)-VEH-NO           PIC 9(4).
> >                      15                      PIC X(4).
> >                  10  (AC)-UNIT-SER-NO          PIC X(10).
> >              05  (AC)-ACT-CODE                 PIC X(6).
> >              05  (AC)-COMPL-CODE               PIC XX.
> >              05  (AC)-ROAD-CALL                PIC XX.
> >
> > COPY ACTIV REPLACING ==(AC) BY ==AX==.
> >
>
> Actually, you must have *something* around the subject to be replaced. The
> REPLACING directive replaces entire words, not substrings of words. The
> "()"
> delimits the "AC-" from the remaining portion of the field names. It could
> just as easily have been
>
>   05 ?AC?-VEH-OR-UNIT.
>
> and
>
>   COPY ACTIV REPLACING ==?AC-?== BY ==XC-==.
>
> Doug.
>
> Doug Werth                             Beechglen Development Inc.
> [log in to unmask]                               Cincinnati, Ohio
>
>

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *