Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Question on COPY VERB

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Question on COPY VERB
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: 356
Location: New York

PostPosted: Tue Jun 03, 2008 7:15 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Tue Jun 03, 2008 7:18 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Tue Jun 03, 2008 7:34 pm    Post subject:
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    Post subject: Reply to: Question on COPY VERB
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Tue Jun 03, 2008 8:57 pm    Post subject: Re: Reply to: Question on COPY VERB
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    Post subject: Re: Reply to: Question on COPY VERB
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jun 05, 2008 10:24 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Jun 06, 2008 9:31 pm    Post subject:
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

Site Director


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

PostPosted: Sat Jun 07, 2008 12:25 am    Post subject:
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

Senior Member


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

PostPosted: Sun Jun 08, 2008 7:01 pm    Post subject:
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

Site Director


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

PostPosted: Sun Jun 08, 2008 11:20 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts How to copy Tape dataset to unix main... chaky All Other Mainframe Topics 4 Fri Jul 08, 2016 2:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us