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

Problem Regarding Copybook


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

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Mon Jun 12, 2006 3:04 pm
Reply with quote

Hi All,

Can we use copybooks in Procedure division?

Regards,
Dipanshu G.
Back to top
View user's profile Send private message
Jerry

New User


Joined: 16 Sep 2005
Posts: 42

PostPosted: Mon Jun 12, 2006 6:32 pm
Reply with quote

Hi Dipanshu,

You can use "copy" verb in procedure division. But the copybook should contain COBOL statements.

Correct me, if I am wrong.

Regards,
Jerry.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Mon Jun 12, 2006 6:37 pm
Reply with quote

You can certainly use copybooks in Proc division.
Typically they are used to call some program or error routine.


ap_mainframes.
Back to top
View user's profile Send private message
dipanshu

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Tue Jun 13, 2006 5:57 pm
Reply with quote

If possible, Plz assist with code
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Jun 14, 2006 10:36 am
Reply with quote

Hi Depanshu,


Program -A

IDENTIFICATION DIVISION.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
..........................
........................

DATA DIVISION.
FILE SECTION.
............
........

WORKING-STORAGE SECTION.
.......
........

PROCEDURE DIVISION.
COPY GENTRACE.









In gentrace..

GENTRACE contain some display statement

DISPLAY '######################################'.
DISPLAY '# PROGRAM: ' TRACE-MODULE-NAME 'NOW ENTERED #'.
DISPLAY '# ======== #'.
DISPLAY '# COMPILED: ' WHEN-COMPILED-DISPLAY ' #'.
DISPLAY '######################################'.

Hope it will helpful
Back to top
View user's profile Send private message
dipanshu

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Wed Jun 14, 2006 10:43 am
Reply with quote

many thanks
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Thu Jun 15, 2006 4:22 pm
Reply with quote

Just to add to that,

You can't have declarative statements in the copybook included in procedure division.
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 Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Trying to change copybook in online c... CICS 4
No new posts Help to Filter File Manager Copybook ... DFSORT/ICETOOL 14
No new posts z/vm installation problem All Other Mainframe Topics 0
Search our Forums:

Back to Top