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
 

 

DCLGEN in the LINKAGE SECTION

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 58
Location: Makati City, Philippines

PostPosted: Wed Sep 01, 2010 7:45 am    Post subject: DCLGEN in the LINKAGE SECTION
Reply with quote

Hi,

Can i use DCLGEN in the LINKAGE SECTION?

Example:


LINKAGE SECTION.
EXEC SQL
INCLUDE DCLGEN
END-EXEC.

Is this possible?

Thanks!
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Sep 01, 2010 8:33 am    Post subject:
Reply with quote

sure it is possible.

but, the second part of a dclgen,
-which is only a copybook created by db2
  • that provides the Declare Table DDL
  • and the cobol data definitions for host variables

contains Cobol Data definitions.

If you define them in the linkage section,
you have to provide addressability.

So, depends on the code you have in the procedure division to SET Address
or Procedure Division Using clause.

If neither are there, you can not INCLUDE the copybook in linkage.
Back to top
View user's profile Send private message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 58
Location: Makati City, Philippines

PostPosted: Wed Sep 01, 2010 8:48 am    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
sure it is possible.

but, the second part of a dclgen,
-which is only a copybook created by db2
  • that provides the Declare Table DDL
  • and the cobol data definitions for host variables

contains Cobol Data definitions.

If you define them in the linkage section,
you have to provide addressability.

So, depends on the code you have in the procedure division to SET Address
or Procedure Division Using clause.

If neither are there, you can not INCLUDE the copybook in linkage.


Thanks for the reply.

Actually i'll be using the 01 level (host var) from the DCLGEN in the procedure division:

PROCEDURE DIVISION USING ZERO-ONE-LEVEL-FROM-DCLGEN.

when compiling the program, im encountering errors.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 01, 2010 9:35 am    Post subject:
Reply with quote

Hello,

Quote:
when compiling the program, im encountering errors.
A completely wasted observation. . . Is there some reason you did not post both the problem code and the compoilder error(s)?

Suggest you restructure your code to the more conventional placement. . .

As DBZ mentions, what you are trying to do can be done, but only if you understand how.

Why do you believe you want this arrangement?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Sep 01, 2010 7:55 pm    Post subject:
Reply with quote

you should keep in mind that if this module is CALLed directly or indirectly from more than one module you will have problems.

The actual working-storage addresses of the host-variables either
  • must be the same for each CALL
  • the flag SQL-END must be reset to zero at the end of the module execution
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Sep 01, 2010 8:37 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
the flag SQL-END must be reset to zero at the end of the module execution


CORRECTION
the flag SQL-INIT must be reset to zero at the end of the module execution before EXITing (or GOBACK).
Actually it is easiest to just make it the first instruction in the module.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Number of parameters in Linkage kregen COBOL Programming 4 Wed Jan 27, 2016 5:13 pm
No new posts Unable to view Unloaded file using DC... Rohit Umarjikar DB2 4 Thu Dec 31, 2015 6:46 pm
No new posts COBOL Parmlist and Associated Linkage... Bill O'Boyle COBOL Programming 10 Fri Dec 20, 2013 9:43 pm
No new posts Linkage Section for Three programs Mr.Niceguy COBOL Programming 13 Sat Jun 01, 2013 7:21 pm
No new posts Expand COBOL copybooks and DCLGEN Mike 1304 COBOL Programming 17 Sun May 26, 2013 10:54 pm


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