<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Copy statement in Cobol in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152207#M39396</link>
    <description>&amp;gt;Wim:  You can try replacing ==(X)== by ==Y== instead.&lt;BR /&gt;&lt;BR /&gt;Yes, "()" is the trick you have to use.  We had to ask the ANSI Committee about it decades ago.&lt;BR /&gt;Note: Using () would mean that copylib member can't be used without REPLACING.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I vaguely remember that HP3000 COBOL reacted differently and that strings were replaced instead of words. But I can be wrong.&lt;BR /&gt;&lt;BR /&gt;I worked on that compiler for 14 years.  Our COBOLII required () since a "-" didn't separate text-words.&lt;BR /&gt;&lt;A href="http://docs.hp.com/cgi-bin/doc3k/B3150090013.11820/1" target="_blank"&gt;http://docs.hp.com/cgi-bin/doc3k/B3150090013.11820/1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Richard: The REPLACING statement is available for Structured ANS COBOL, but it is compiler-dependent and the recommendation is to avoid its use. &lt;BR /&gt;&lt;BR /&gt;REPLACE or REPLACING?&lt;BR /&gt;REPLACE is COBOL 85 Standard.&lt;BR /&gt;But REPLACE won't help in this case, the rules for COPY and REPLACE are the same.</description>
    <pubDate>Sat, 01 Mar 2008 07:27:36 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-03-01T07:27:36Z</dc:date>
    <item>
      <title>Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152200#M39389</link>
      <description>Hi, &lt;BR /&gt;I am coding a program where I have to use the same copybook for both input and output layout. &lt;BR /&gt;to avoid ambiguity in variable names I have used the replacing statement . &lt;BR /&gt;&lt;BR /&gt;like &lt;BR /&gt;COPY RAPCLODT REPLACING ==RAPCLODT== BY ==RAP-IN==. &lt;BR /&gt;&lt;BR /&gt;The original copybook looks like: &lt;BR /&gt;01 RAPCLODT. &lt;BR /&gt;05 RAPCLODT-DB-AREA PIC S9(04) COMP. &lt;BR /&gt;05 RAPCLODT-DB-RAP PIC X(06). &lt;BR /&gt;05 RAPCLODT-ACCT-KEY. &lt;BR /&gt;. &lt;BR /&gt;. &lt;BR /&gt;. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But the replace stament is replacing only the first occurence of the literal. &lt;BR /&gt;&lt;BR /&gt;it looks like &lt;BR /&gt;&lt;BR /&gt;01 RAP-IN. &lt;BR /&gt;05 RAPCLODT-DB-AREA PIC S9(04) COMP. &lt;BR /&gt;05 RAPCLODT-DB-RAP PIC X(06). &lt;BR /&gt;05 RAPCLODT-ACCT-KEY. &lt;BR /&gt;. &lt;BR /&gt;. &lt;BR /&gt;. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Kindly tell me how do i solve this issue. &lt;BR /&gt;Reply ASAP. &lt;BR /&gt;&lt;BR /&gt;Thanks in advance, &lt;BR /&gt;Karthikeyan.</description>
      <pubDate>Thu, 28 Feb 2008 08:35:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152200#M39389</guid>
      <dc:creator>Cobol Copy</dc:creator>
      <dc:date>2008-02-28T08:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152201#M39390</link>
      <description>you can now reference each like&lt;BR /&gt;move rapclodt-acct-key of rap-in to rapctodt-acct-key of rap-out.&lt;BR /&gt;or use move corresponding&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Feb 2008 08:58:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152201#M39390</guid>
      <dc:creator>Phil.Howell</dc:creator>
      <dc:date>2008-02-28T08:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152202#M39391</link>
      <description>If there is a REPLACING phrase, the compiler changes the source text as it copies it. The compiler replaces each successfully matched occurrence of a text-matching argument in the source text by the corresponding replacement item.&lt;BR /&gt;&lt;BR /&gt;The comparison operation starts with the leftmost source text text-word and the first text-matching argument. The compiler compares the entire text-matching argument to an equivalent number of consecutive source text text-words. &lt;BR /&gt;***&lt;BR /&gt;Thus it only replaces words, not strings.&lt;BR /&gt;&lt;BR /&gt;Wim manual reader</description>
      <pubDate>Thu, 28 Feb 2008 09:24:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152202#M39391</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-02-28T09:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152203#M39392</link>
      <description>You could also put RAPCLODOT in brackets in both the copycode and the copy statement.&lt;BR /&gt;COPY RAPCLODT REPLACING ==(RAPCLODT)== BY ==(RAP-IN)==. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Feb 2008 10:14:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152203#M39392</guid>
      <dc:creator>Phil.Howell</dc:creator>
      <dc:date>2008-02-28T10:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152204#M39393</link>
      <description>Phil,&lt;BR /&gt;&lt;BR /&gt;You will have the () in your source then. You can try replacing ==(X)== by ==Y== instead.&lt;BR /&gt;&lt;BR /&gt;I vaguely remember that HP3000 cobol reacted differently and that strings were replaced instead of words. But I can be wrong.&lt;BR /&gt;&lt;BR /&gt;Wim without compiler.</description>
      <pubDate>Thu, 28 Feb 2008 10:45:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152204#M39393</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-02-28T10:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152205#M39394</link>
      <description>&lt;A href="http://h71000.www7.hp.com/wizard/wiz_5132.html" target="_blank"&gt;http://h71000.www7.hp.com/wizard/wiz_5132.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The ==(X)== by ==RAP-IN== should work.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Thu, 28 Feb 2008 12:37:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152205#M39394</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-02-28T12:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152206#M39395</link>
      <description>The REPLACING statement is available for Structured ANS COBOL, but it is compiler-dependent and the recommendation is to avoid its use. The example you give shows you are trying to change all occurrences of a string-value in your copy-member, as the compiler places it into your program, with another string-value -- as if you expect the compiler to recognize it just as an editor (such as SPF) would. The compiler does not. Instead, it has correctly replaced the specified data-item (RAPCLODT) with the replacing data-item (RAP-IN).&lt;BR /&gt;&lt;BR /&gt;I suggest you make an extra copy in your library, give it a different name, open it and use your editor's features to make a global change to the item-name; then your program will contain two COPY statements (as it does now) but both will be more straight-forward and will make future trouble-shooting and maintenance easier due to reduced confusion opportunity. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Feb 2008 18:16:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152206#M39395</guid>
      <dc:creator>Richard Anthony</dc:creator>
      <dc:date>2008-02-29T18:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152207#M39396</link>
      <description>&amp;gt;Wim:  You can try replacing ==(X)== by ==Y== instead.&lt;BR /&gt;&lt;BR /&gt;Yes, "()" is the trick you have to use.  We had to ask the ANSI Committee about it decades ago.&lt;BR /&gt;Note: Using () would mean that copylib member can't be used without REPLACING.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I vaguely remember that HP3000 COBOL reacted differently and that strings were replaced instead of words. But I can be wrong.&lt;BR /&gt;&lt;BR /&gt;I worked on that compiler for 14 years.  Our COBOLII required () since a "-" didn't separate text-words.&lt;BR /&gt;&lt;A href="http://docs.hp.com/cgi-bin/doc3k/B3150090013.11820/1" target="_blank"&gt;http://docs.hp.com/cgi-bin/doc3k/B3150090013.11820/1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Richard: The REPLACING statement is available for Structured ANS COBOL, but it is compiler-dependent and the recommendation is to avoid its use. &lt;BR /&gt;&lt;BR /&gt;REPLACE or REPLACING?&lt;BR /&gt;REPLACE is COBOL 85 Standard.&lt;BR /&gt;But REPLACE won't help in this case, the rules for COPY and REPLACE are the same.</description>
      <pubDate>Sat, 01 Mar 2008 07:27:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152207#M39396</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-03-01T07:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152208#M39397</link>
      <description>So I was wrong. Still have a 1998 MPE tape but no machine to load the tape.&lt;BR /&gt;&lt;BR /&gt;Karthikeyan : pls confirm that it works.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Mon, 03 Mar 2008 12:49:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152208#M39397</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-03-03T12:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152209#M39398</link>
      <description>yes, &lt;BR /&gt;looking at all the replies, i would like to have a say.&lt;BR /&gt;these are some of the limitations: &lt;BR /&gt;1. I cannot create a copy of the copybook and avoid using the replacing statement.&lt;BR /&gt;2. I dont have the authority to change the production copybook either from RAPCLODT to (RAPCLODT) or even ::rapclodt:: (some people suggest the second one too).&lt;BR /&gt;&lt;BR /&gt;If the people who replies have a valid MVS login, try reading a QW on copy.&lt;BR /&gt;there are few examples there.&lt;BR /&gt;just giving a sample:&lt;BR /&gt;&lt;BR /&gt;actual copybook: copybook1&lt;BR /&gt;&lt;BR /&gt;01 A.&lt;BR /&gt;  05 B PIC 9(1).&lt;BR /&gt;  05 C OCCURS 1 TO 9 TIMES DEPENDING ON B PIC X(5). (SAY SOMETHING LIKE THIS).&lt;BR /&gt;&lt;BR /&gt;when a copy statement was issued like:&lt;BR /&gt;&lt;BR /&gt;copy copybook1 replacing a by employee&lt;BR /&gt;                         b by emp-id&lt;BR /&gt;                         c by emp-seat.&lt;BR /&gt;&lt;BR /&gt;it replaces all the a's, b's and c's(note - b is there twice in the cpybook).&lt;BR /&gt;&lt;BR /&gt;but in my example the replacing statement replaced only first occurence.&lt;BR /&gt;&lt;BR /&gt;i do accept all your answers, but can anyone justify the qw in mvs?&lt;BR /&gt;&lt;BR /&gt;or tell the author that he is wrong?&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;karthikeyan.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Mar 2008 12:38:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152209#M39398</guid>
      <dc:creator>Cobol Copy</dc:creator>
      <dc:date>2008-03-04T12:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152210#M39399</link>
      <description>He's correct. All IDENTIFIERS are replaced. Not all STRINGS.&lt;BR /&gt;&lt;BR /&gt;If you can't change the rapclodt copymember you will not be able to solve this case.&lt;BR /&gt;And if you do change it, you will need to add "replacing ==(X)== by ==RAPCLODT==" where there is no replacing clause.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Tue, 04 Mar 2008 13:03:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152210#M39399</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-03-04T13:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152211#M39400</link>
      <description>MVS is another country&lt;BR /&gt;they do thing differently there&lt;BR /&gt;&lt;BR /&gt;The compiler will tell you about any  ambiguity in variable names&lt;BR /&gt;&lt;BR /&gt;01 RAP-IN. &lt;BR /&gt;05 RAPCLODT-DB-AREA PIC S9(04) COMP. &lt;BR /&gt;05 RAPCLODT-DB-RAP PIC X(06). &lt;BR /&gt;05 RAPCLODT-ACCT-KEY. &lt;BR /&gt;&lt;BR /&gt;01 RAP-OUT. &lt;BR /&gt;05 RAPCLODT-DB-AREA PIC S9(04) COMP. &lt;BR /&gt;05 RAPCLODT-DB-RAP PIC X(06). &lt;BR /&gt;05 RAPCLODT-ACCT-KEY. &lt;BR /&gt;&lt;BR /&gt;MOVE RAPCLODT-ACCT-KEY TO &lt;WHEREEVER&gt;.&lt;BR /&gt;will be flagged by the compiler as an error&lt;BR /&gt;&lt;BR /&gt;MOVE RAPCLODT-ACCT-KEY OF RAP-IN&lt;BR /&gt;TO   RAPCLODT-ACCT-KEY OF RAP-OUT.&lt;BR /&gt;will work&lt;BR /&gt;&lt;BR /&gt;Phil&lt;BR /&gt;&lt;BR /&gt;&lt;/WHEREEVER&gt;</description>
      <pubDate>Tue, 04 Mar 2008 23:14:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152211#M39400</guid>
      <dc:creator>Phil.Howell</dc:creator>
      <dc:date>2008-03-04T23:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Copy statement in Cobol</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152212#M39401</link>
      <description>thanks phil.. ur reply was useful.&lt;BR /&gt;&lt;BR /&gt;karthikeyan</description>
      <pubDate>Wed, 05 Mar 2008 03:21:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/copy-statement-in-cobol/m-p/4152212#M39401</guid>
      <dc:creator>Cobol Copy</dc:creator>
      <dc:date>2008-03-05T03:21:08Z</dc:date>
    </item>
  </channel>
</rss>

