Several of our programs do a COPY ???? REPLACING 'XXX' BY IN.
When these programs are compiled the following error occurs.
CPBACH.cbl:199: Error: syntax error
Where line 198:199 is
01 IN-RECORD. COPY CPWWPOST REPLACING 'POST' BY IN.
This syntax works on both z/OS and MicroFocus.
I'm thinking that since IN is a resevered word, it is being checked for when doing the replacing. Although, in this situation, IN is never used by itself in any of the fields once the copybook is expanded.
Logged In: YES
user_id=1138256
Originator: NO
This was covered on the mailing list.
Invalid syntax.
Use psuedo-text replacement.
ie.
REPLACING =='POST'== BY ==IN==.
This is ALWAYS compatible.
I've rechecked this: All COBOL Standards allow the syntax
with the explanation:
Therefore: the sample is valid and while the workaround "pseudotext" always works it would be nice to fix this.
This may be solved already, not checked yet.
Fixed with [r5111].
Related
Commit: [r5111]
@sf-mensch Apologies for not addressing this one before, I did not see it was assigned to me (I probably missed the notification — not really connected on a 31st December ;-) )
@sf-mensch BTW I did not follow the recent changes in handling of
REPLACE
. But I'm a bit surprisedREPLACING 'POST' BY PREFIX.
should replace'POST'-A
withPREFIX-A
(as in the new test in [r5111], where it'sIN
instead ofPREFIX
). At least I don't think it conforms to what ISO/ICE 2014 describes as a match in its text manipulation section (where the dash-
is not to be considered a separator like:
or(
and)
).Related
Commit: [r5111]
The dash would only match for LEADING.
The reason that this works is that the first part is a literal used as pseudo word, which was a common solution for LEADING before ISO2002.