View previous topic :: View next topic |
Author |
Message |
misi01 Advanced
Joined: 02 Dec 2002 Posts: 628 Topics: 176 Location: Stockholm, Sweden
|
Posted: Fri Dec 04, 2020 1:40 am Post subject: REPLACE OFF |
|
|
I was looking at some old COBOL code and found the following:-
Code: |
01 PNNK0-PARM-AREA.
REPLACE ==15 FILLER==
BY ==15 PNNK0-FILLER==
.
COPY VNODNK0.
REPLACE OFF.
|
Is the statement REPLACE OFF really needed or is it because of the way they've specified the REPLACE statement?
Would the following be the same?
Code: |
01 PNNK0-PARM-AREA.
COPY VNODNK0 REPLACING ==15 FILLER==
BY ==15 PNNK0-FILLER==.
|
_________________ Michael |
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Fri Dec 04, 2020 8:53 am Post subject: |
|
|
It's been a long time ago, but if I remember correctly, it means, "skip expanding the member named in the copy statement". It was a method of reducing the length of the listing. Have you tried Google? _________________ ....Terry |
|
Back to top |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 628 Topics: 176 Location: Stockholm, Sweden
|
Posted: Sat Dec 05, 2020 2:58 am Post subject: |
|
|
Google. Yes, but all it really does is point me to the syntax.
It's more a case of wondering why you would bother to go for the first variation which (theoretically) cause problems of you removed the REPLACE OFF by mistake.
With the second variation, the risk doesn't exist. _________________ Michael |
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Mon Dec 07, 2020 9:07 am Post subject: |
|
|
Have you compiled with/without the REPLACE OFF and compared the results? _________________ ....Terry |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
Posted: Mon Dec 07, 2020 5:33 pm Post subject: Re: REPLACE OFF |
|
|
misi01 wrote: |
Is the statement REPLACE OFF really needed or is it because of the way they've specified the REPLACE statement?
|
Misi01,
The older compilers needed the REPLACE off statement as the substitution actions of the REPLACE statement continue to affect program source until the REPLACE statement is either superseded by a new REPLACE statement or turned off by the REPLACE OFF statement.
With the newer compilers, you don't need the exclusive OFF statement. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 628 Topics: 176 Location: Stockholm, Sweden
|
Posted: Thu Dec 10, 2020 10:25 am Post subject: |
|
|
Terry_Heinze wrote: | Have you compiled with/without the REPLACE OFF and compared the results? |
No access to a mainframe at the moment _________________ Michael |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Dec 11, 2020 5:58 am Post subject: |
|
|
Quote: | No access to a mainframe at the moment |
COBOL compilers are available, for free, for Windows and Linux. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 628 Topics: 176 Location: Stockholm, Sweden
|
Posted: Mon Dec 14, 2020 5:23 am Post subject: |
|
|
Döööööh. I already have GnuCOBOL and Winedit installed on my PC. It'll be interesting to see if there's any difference. _________________ Michael |
|
Back to top |
|
|
|
|