View previous topic :: View next topic
|
Author |
Message |
angi_pri
New User
Joined: 04 Jun 2008 Posts: 6 Location: bangalore
|
|
|
|
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 |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
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 |
|
|
angi_pri
New User
Joined: 04 Jun 2008 Posts: 6 Location: bangalore
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you need the INCLUDE to insure the copybook is expanded for the db2 pre-compiler.
you can mix in same copybook. |
|
Back to top |
|
|
nagamanjari
New User
Joined: 25 Apr 2008 Posts: 9 Location: hyderabad
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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:
ibmmainframes.com/faq.php?mode=bbcode |
|
Back to top |
|
|
|