× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I don't see including the DS in the copy member as being the problem.

The problem is the MyDS is a very poor name!

I often have DS's in a copy member without wrapping them in /if
defines. But I give my DSs a usable name and following the idea of
DRY (Don't Repeat Yourself) a DS of a given name is only defined in
one place.

If for some reason, as DS is needed in two places (a good example, is
the errorDS I use for IBM API's) then I pull it out of it's original
place an put it into it's own copy book, which is then /included into
the copy books that need them.

Like Duane, I use /if defined at the top of a copy book so that for
any given copy book, it is only ever included once.

Charles

On Wed, Sep 23, 2009 at 1:15 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:
First option - including DS definitions in a proto member s not a
terribly good idea unless you are going to incorporate compiler
directives. So you could add:

 /If not defined (MyDS)
D MyDS       E DS     extname( myfile)
 /Define (MyDS)
 /EndIf

Sysntax may not be right but you'll get the picture.  Include this in
all protos that include the MyDS definition. This ensures you will
only get it copied once. You could also replace the definition of MyDS
with a /COPY of the MyDS details.

Second option - Use the PREFIX keyword on the MyDS definition to give
each copy a unique name.

It all depends on whether you want/need multiple copies of MyDS.


Jon Paris

www.Partner400.com
www.SystemiDeveloper.com



On 23-Sep-09, at 1:00 PM, rpg400-l-request@xxxxxxxxxxxx wrote:

I've just added a prototype via a copybook in my module and it won't
compile because it now has several fields defined more than once.

I discover that I now have 2 prototypes copied in, each one with a
data structure parameter declared like so :

D Parm                     likeds (myds)
D MyDS       E DS     extname( myfile)

...

Any thoughts on this? I'm not looking forward to taking time out to
correct this, test it, etc. Maybe there's a work around?


--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.