Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 215
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: 6970
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: 6970
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 The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us