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

Copy & include statements in Procedure division


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

New User


Joined: 16 Feb 2006
Posts: 14

PostPosted: Mon Jun 26, 2006 11:36 am
Reply with quote

Hi,

what are the contents present in the following code

PROCEDURE DIVISION.
PARA1.

COPY MEMBER NAME
INCLUDE MEMBER NAME

Thanks in advance

Regards

Mahesh
Back to top
View user's profile Send private message
param_rajesh_2001
Warnings : 1

New User


Joined: 23 Jun 2006
Posts: 18
Location: Bangalore

PostPosted: Mon Jun 26, 2006 12:44 pm
Reply with quote

Both the stmt does the same , The first STMT "COPY MEMBER NAME " ..
Cobol Copy books get copied in the comile time here member "NAME" COPIED during the compile time

the second "INCLUDE MEMBER NAME " MEMBER NAME copied during the pre-compile time .
Back to top
View user's profile Send private message
creator.abhishek

New User


Joined: 07 May 2006
Posts: 32
Location: Pune

PostPosted: Mon Jun 26, 2006 12:58 pm
Reply with quote

Both does the same thing, onlt the difference is include is precompilation stmt and copy is complitaion stmt. both r stmt of working-storage division, it doesn't work in procedure division .
Back to top
View user's profile Send private message
k.pavankumar

New User


Joined: 22 May 2006
Posts: 8

PostPosted: Mon Jun 26, 2006 1:22 pm
Reply with quote

Hi Mahesh.

The COPY is the Cobol statement and the INCLUDE belongs to the Precompilation expanision.

In your description there is a fault, while writing the include statement you have to place it in EXEC SQL and END-EXEC Block.

EXEC SQL
INCLUDE <copybook>
END EXEC.

According to your declaration you will definitely face a compilation error.
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Mon Jun 26, 2006 3:25 pm
Reply with quote

Hi,

Just a little correction,
I think, both copy and include statements works fine even in procedure divisions.

Thanks,
Parikshit
Back to top
View user's profile Send private message
creator.abhishek

New User


Joined: 07 May 2006
Posts: 32
Location: Pune

PostPosted: Mon Jun 26, 2006 4:24 pm
Reply with quote

Hi Parikshit, i think procedure division is for processing , which can be run in compilation time, how u say precompilation stmt is able to come there. plz let me know.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts VB to VB copy - Full length reached SYNCSORT 8
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
Search our Forums:

Back to Top