HP3000-L Archives

March 2002, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Wayne R. Boyer" <[log in to unmask]>
Reply To:
Date:
Mon, 25 Mar 2002 22:06:06 EST
Content-Type:
text/plain
Parts/Attachments:
text/plain (52 lines)
In a message dated 3/25/02 1:23:34 PM Pacific Standard Time,
[log in to unmask] writes:


> Seems like there is no difference between $INCLUDE and
> COPY statement when it comes to Practical purposes.
>
> Does anyone has comments on this. Or disagree with me.
>
>

Well, I'm assuming that you are speaking of the COBOL COPY statement and the
COBOL COPYLIB approach.  There are some differences between COPY and $INCLUDE
and I have made a technical design choice to only use the COPY statement
method of inserting chunks of common source code into source code files.  The
reasons behind my decision are:

1 - COPY is part of the international COBOL language standard and is portable
across compilers and OS platforms.  The $INCLUDE compiler command is a
HP-specific implementation and may or may not work in other COBOL language
environments.

2 - With COPY statements you can have one large COPYLIB file containing
hundreds of chunks of source code.  Using $INCLUDE you would have hundreds of
little files to keep track of.  You can also have multiple COPYLIB files but
you don't need to do so if you use unique member names.  I put everything
into one big COPYLIB.

3 - Examine how $INCLUDE and COPY use groupnames and accountnames.  If you
hardcode hundreds of group/account names, how do you deal with redirecting
hundreds of different $INCLUDE statements when you are dealing with a major
software change?  When compiling I use
:FILE COPYLIB=filename.group.acct and never place a groupname or accountname
in any COPY statement.  This makes it easy to point the compiler at a new or
different version of the COPYLIB.

4 - The COPY... REPLACING construct is interesting but I have rarely used it.
 The isn't an equivalent $INCLUDE... REPLACING mechanism.

5 - $INCLUDE does allow nested includes... anybody ever tried this using
COPY?  I don't think that it works.  Is this due to the COBOL std for COPY?

So those are my thoughts on this subject.  I'm sure others will have comments
as well.  Or maybe I should say REMARKS. ?

Wayne Boyer
Today's trivia question: Can you have a COBOL source code file that contains
nothing but a single COPY statement?  How about nothing but $INCLUDE...?

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2