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
 

 

Sample Program using Procedure Division Copybook

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
angi_pri

New User


Joined: 04 Jun 2008
Posts: 6
Location: bangalore

PostPosted: Mon Aug 11, 2008 12:07 pm    Post subject: Sample Program using Procedure Division Copybook
Reply with quote

Hi friend,

Can anyone post a sample program, which uses procedure division copybook. The copybook has both sequentail and non-sequentail statements.
Back to top
View user's profile Send private message

sri_mf

Active User


Joined: 31 Aug 2006
Posts: 216
Location: India

PostPosted: Mon Aug 11, 2008 12:14 pm    Post subject: Re: Sample Program using Procedure Division Copybook
Reply with quote

angi_pri wrote:
Hi friend,

Can anyone post a sample program, which uses procedure division copybook. The copybook has both sequentail and non-sequentail statements.


what do you mean by sequentail and non-sequentail statements
Back to top
View user's profile Send private message
angi_pri

New User


Joined: 04 Jun 2008
Posts: 6
Location: bangalore

PostPosted: Mon Aug 11, 2008 12:31 pm    Post subject:
Reply with quote

We want to have both cobol statements (like Move/add etc) as well as some DB2 SQL statements in a single Procedural copybook. Now If we use INCLUDE in the procedure division will it work? or we need to have two different copybboks one for cobol move statements and the other for DB2 Sql statements?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon Aug 11, 2008 1:53 pm    Post subject:
Reply with quote

you need the INCLUDE to insure the copybook is expanded for the db2 pre-compiler.

you can mix in same copybook.
Back to top
View user's profile Send private message
nagamanjari

New User


Joined: 25 Apr 2008
Posts: 9
Location: hyderabad

PostPosted: Wed Aug 20, 2008 12:50 pm    Post subject:
Reply with quote

Hi Dick,
I am also having the problem of including both move statement and some SQL codes within a single procedural copybbok. I tried to INCLUDE the copybook in procedure division like:
MOVE 'UBET440.VTDC_PER_MSTR'
TO WS-TBL-NAME
MOVE 'INSERT' TO WS-OPTION
INCLUDE DB2CPL.
EVALUATE SQLCODE
WHEN 0
CONTINUE

But the copybook is not getting expanded and hence there is compilation error. Compiler is assuming the Include to be procedure name and so not expanding the copybook. Could you kindly throw some light on this issue.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Aug 20, 2008 4:26 pm    Post subject:
Reply with quote

INCLUDE is a DB2 keyword, recognized by the DB2 precompiler.
in COBOL I would code
Code:
EXEC SQL INCLUDE <copybook name> END-EXEC
or
Code:

EXEC SQL
     INCLUDE <copybook name>
END-EXEC



by the way, here is a link for bbcode and how to use it. It will make your code snipets readable:
http://ibmmainframes.com/faq.php?mode=bbcode
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 Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


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