IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Question on COPY VERB


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Banabas Rout

New User


Joined: 17 May 2008
Posts: 4
Location: Tampa

PostPosted: Tue Jun 03, 2008 7:08 pm
Reply with quote

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

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Tue Jun 03, 2008 7:15 pm
Reply with quote

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

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Jun 03, 2008 7:18 pm
Reply with quote

Move?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 03, 2008 7:19 pm
Reply with quote

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

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Jun 03, 2008 7:34 pm
Reply with quote

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

New User


Joined: 17 May 2008
Posts: 4
Location: Tampa

PostPosted: Tue Jun 03, 2008 8:46 pm
Reply with quote

COPY can be used in the Procedure Division to include a Procedure Division Copybook.
Is there an alternative Verb for COPY?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 03, 2008 8:56 pm
Reply with quote

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

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Jun 03, 2008 8:57 pm
Reply with quote

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

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Wed Jun 04, 2008 7:32 am
Reply with quote

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
View user's profile Send private message
ravi.veda

New User


Joined: 30 Mar 2007
Posts: 7
Location: banglore

PostPosted: Thu Jun 05, 2008 5:36 pm
Reply with quote

hi, instead of copy we can write ++INCLUDE MEMBER in procedure division. We canot use copy in procedure division
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jun 05, 2008 6:03 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 05, 2008 10:24 pm
Reply with quote

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

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Jun 06, 2008 9:31 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Jun 07, 2008 12:25 am
Reply with quote

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

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sun Jun 08, 2008 7:01 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Jun 08, 2008 11:20 pm
Reply with quote

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 icon_smile.gif

I don't know what a "passive called program" means icon_confused.gif How is a "passive call" implemented?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Question for file manager IBM Tools 7
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top