MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

REPLACE OFF

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 620
Topics: 173
Location: Stockholm, Sweden

PostPosted: Fri Dec 04, 2020 1:40 am    Post subject: REPLACE OFF Reply with quote

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
View user's profile Send private message Send e-mail
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Fri Dec 04, 2020 8:53 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
misi01
Advanced


Joined: 02 Dec 2002
Posts: 620
Topics: 173
Location: Stockholm, Sweden

PostPosted: Sat Dec 05, 2020 2:58 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Mon Dec 07, 2020 9:07 am    Post subject: Reply with quote

Have you compiled with/without the REPLACE OFF and compared the results?
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Mon Dec 07, 2020 5:33 pm    Post subject: Re: REPLACE OFF Reply with quote

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 - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 620
Topics: 173
Location: Stockholm, Sweden

PostPosted: Thu Dec 10, 2020 10:25 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Dec 11, 2020 5:58 am    Post subject: Reply with quote

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
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 620
Topics: 173
Location: Stockholm, Sweden

PostPosted: Mon Dec 14, 2020 5:23 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group