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: 6966
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: 6966
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 SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm


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