View previous topic :: View next topic
|
Author |
Message |
Banabas Rout
New User
Joined: 17 May 2008 Posts: 4 Location: Tampa
|
|
|
|
What is the cobol verb that can be used in procedure division instead of COPY?
Please provide if there is any Compiler restriction for using the Verb |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
For what purpose you want to use similar verb in Procedure division?
For executable statements, you can use COPY verb in procedure division also.
KSK |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
You can use COPY in the procedure division. Restrictions -- see the COBOL manuals in IBM MANUALS at the top of the page. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
One more guess..
COPY is used in FILE SECTION under DATA DIVISION or in Working-storage..why would you need COPY, perhaps I didn't understand question.. |
|
Back to top |
|
|
Banabas Rout
New User
Joined: 17 May 2008 Posts: 4 Location: Tampa
|
|
|
|
COPY can be used in the Procedure Division to include a Procedure Division Copybook.
Is there an alternative Verb for COPY? |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
No there is no alternative verb for COPY but you can use COPY in the procedure division. Depending on your source library there may be alternatives but they won't be COBOL verbs and they usually don't have the replacing option. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Banabas Rout wrote: |
COPY can be used in the Procedure Division to include a Procedure Division Copybook.
Is there an alternative Verb for COPY? |
COPY is not a verb, it is a compiler directing statement. |
|
Back to top |
|
|
yogeshwar_ade
Active User
Joined: 31 Aug 2006 Posts: 103 Location: INDIA
|
|
|
|
Banabas Rout wrote: |
COPY can be used in the Procedure Division to include a Procedure Division Copybook.
Is there an alternative Verb for COPY? |
Yes, We can use COPY in Procedure Division to include commonly used Code in programs(Just like we use COPYBOOKs). We call such Code as COPYCODE.
It is Compiler Directive statment.
I think there is no alternative for COPY. Either you have to write that code in your program or you have to use COPY.
Correct me if I am wrong.
Yogeshwar |
|
Back to top |
|
|
ravi.veda
New User
Joined: 30 Mar 2007 Posts: 7 Location: banglore
|
|
|
|
hi, instead of copy we can write ++INCLUDE MEMBER in procedure division. We canot use copy in procedure division |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
ravi.veda wrote: |
hi, instead of copy we can write ++INCLUDE MEMBER in procedure division. We canot use copy in procedure division |
I use -inc and it can be in the procedure division and I also use COPY and I can use it in the procedure division. It all depends on what tools you are using and how the compile jcl is set up. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
While COPY and ++INCLUDE provide a similar function, they are not exactly the same.
Quote: |
We canot use copy in procedure division |
If this is true on your system, it is a local (site-specific) restriction. As Craig mentioned, COPY will work in the Procedure Division. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
dick scherrer wrote: |
Quote: |
We canot use copy in procedure division |
If this is true on your system, it is a local (site-specific) restriction. As Craig mentioned, COPY will work in the Procedure Division. |
This is restricted at my shop, if not, at least in my module. But what's the benefit of such "COPYs", if some "piece" of code is to be included/called in many program, can't we use CALLED programs, might be some "passive" CALLED programs. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
This is restricted at my shop, if not, at least in my module. |
Then you have a local restriction also. . .
Quote: |
But what's the benefit of such "COPYs", if some "piece" of code is to be included/called in many program, can't we use CALLED programs, might be some "passive" CALLED programs |
I'm not familiar with "passive called programs". One reason to COPY code in the procedure division is so the code can be performed rather than called. There was a time when this could make a huge performance difference. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
dick scherrer wrote: |
Then you have a local restriction also. . . |
I think, we were never is need of such a COPY...
dick scherrer wrote: |
I'm not familiar with "passive called programs". One reason to COPY code in the procedure division is so the code can be performed rather than called. There was a time when this could make a huge performance difference. |
Lately I've seen this type of coding in other module of my project but in real this approach doesn't attract me, should not it be considered such a thing which can be done but should not be done ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
Quote: |
Lately I've seen this type of coding in other module of my project but in real this approach doesn't attract me, should not it be considered such a thing which can be done but should not be done ? |
If you tell me what it means, i'll maybe have an opinion
I don't know what a "passive called program" means How is a "passive call" implemented? |
|
Back to top |
|
|
|