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
 

 

Problem Regarding Copybook

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Problem Regarding Copybook
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    Post subject:
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    Post subject: Re: Problem Regarding Copybook
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    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Wed Jun 14, 2006 10:36 am    Post subject:
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    Post subject:
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    Post subject:
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    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 SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm


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