Page 1 of 1

copybook

PostPosted: Fri Sep 17, 2010 7:28 pm
by swapna namburu
i am doing a case study using cobol files with copybook and db2.
if we compie db2 + cobol we use preclink. but how we include copybook in preclink.

Re: copybook

PostPosted: Fri Sep 17, 2010 11:04 pm
by dick scherrer
Hello,

What is "preclink" on your system? This is not a standard term most places.

If preclink is your process that invoked the db2 pre-compiler before the actual compile, INCLUDE is typically used to expand sql for the pre-compilation.

What exactly are you stuck with? Once we understand the doubt, we should be able to clarify.

Re: copybook

PostPosted: Sun Sep 19, 2010 8:10 pm
by swapna namburu
IN file section instead of writing ffile structure we invoked the copy book.
data division.

file section
fd file1
exec sql
include copybook1
end-exec.
replacing ==:copy:== by ==emp==.


IN this db2 precompiler shows erors. i can't resolve it.
Is this format or declaration is correct or not

Re: copybook

PostPosted: Sun Sep 19, 2010 10:07 pm
by dick scherrer
Hello,

You have created your own syntax - what is coded is not in any manual. . . The code is trying to combine an INCLUDE with a feature of COPY. As far as i know, this cannot be done.

Read here about COPY:
http://publibz.boulder.ibm.com/cgi-bin/ ... lr50/8.1.4


This is the link to the COBOL Language Reference Table of Contents:
http://publibz.boulder.ibm.com/cgi-bin/ ... 0/CONTENTS

Suggest you both bookmark the ToC link as well as download a local copy of the manual.