× 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.



No, I'd integrate the External Data structure into the Copy Member of the
prototypes and define the parameter fields with LIKEDS.
To make sure that the data structure is only defined once I'd surround it
with a compiler directive (at least this is the way I work) and qualify it.
In this way the data structure is always available to define other data
structures with the same format.

1. Copy-Member 1 - Data Structure Definition:

D/If Not Defined RefDSMyFile
D/Define RefDSMyFile
D RefDSMyFile E DS ExtFile(MyFile) Qualified
Based(DummyPtr)
/EndIf

With release 6.1 you can use the key word TEMPLATE instead of Based.

2. Copy-Member 2 - Prototype
/INCLUDE QCPYLESRC,REFMYFile
D MyProc PR
D ParOut LikeDS(RefDSMyFile)
D ParIn Like(Fld1)
D ParIn2 10I 0


Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von David FOXWELL
Gesendet: Monday, 14. September 2009 12:26
An: RPG programming on the IBM i / System i
Betreff: RE: Physical file used for declaring a data structure

Hi Birgitta, Mihael,

These data structures are being passed as parameters.The prototype ds would
need to be defined on the externally defined ds.

Would you therefore always need two /copy? One for the prototype and one for
the DS?


-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Birgitta Hauser
Envoyé : lundi 14 septembre 2009 11:49
À : 'RPG programming on the IBM i / System i'
Objet : AW: Physical file used for declaring a data structure

Hi,

in either way I'd put the external data structures into a
copy member and define them as based and embed them into the program.
In this way no storage will be reserved when activating the
program and the fields can only be used to define other fields.

D MyDS E DS EXTNAME(MyFile) Based(DummyPtr)

When using data structures instead of field definitions,
zoned fields get defined as zoned fields (and not as packed fields).
In former times it was much easier to define and change an
external data structure than an internal described data structure.
In either way I'd prefer to have an external data structure
than defining the fields directly.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the
stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek
Bok) "What is worse than training your staff and losing them?
Not training them and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von David FOXWELL
Gesendet: Monday, 14. September 2009 11:12
An: RPG programming on the IBM i / System i
Betreff: Physical file used for declaring a data structure

Hi,

We have a few DDS PF that are used uniquely to describe a
data structure in a program.

eg, D MyDS E DS EXTNAME(MyFile)

These files are destined never to contain any data and are
even placed in libraries separate from libraries containing
files with data. They are just there so that the RPG source
will compile.

My question is, what's the point of this? Why not just write
D specs in a copy book like one would a prototype?

Thanks
--
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.


--
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 ...

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.