Quantcast
Channel: Visual COBOL
Viewing all articles
Browse latest Browse all 5819

Forum Post: RE: Copy/Replacing statement

$
0
0
During processing of COPY REPLACING the PICTURE string is parsed just like any other text in the input source, so that for instance the PICTURE string associated with MPPOLY-MM is broken up into separate tokens 'X', '(', '01', ')'.  In terms of COPY REPLACING, it is therefore correct that the 01 is replaced in this context as these are the leading (and only) characters in this token. Possibly this looks a bit clunky but the only way I can see of achieving what you want is something like:           Copy "PrmPolcy.fd" replacing leading ==MP==     By ==VPPINew==,                                        leading ==PRM==    By ==VPPINew==,                                                ==(01)==   By ==(01)==,                                                == 01 == By == 02 ==. Since the COPY REPLACING code will use the first matching alternative, the extra replacing branch ensures that the PICTURE strings are unchanged.  Of course, there could still be problems if the copied file happened to have a data item with 'VALUE 01', or any other use of 01 other than as a level number.

Viewing all articles
Browse latest Browse all 5819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>