Hi,
I'm also using a data structure of the field reference file and data
structures that are passed as parameters in my prototypes.
There is almost no field within my application that is not defined with like
or likeDS. Exceptions maybe indexes for looping through arrays.
The data structures itself are (most times) in separate copy members and
surrounded with compiler directives. These copy members are included within
my prototypes (nested copy members).
Also the names of the references start with REF (except my field reference
file which is simply named FldRef).
In this way I never have any problems except I have to use qualified data
structures.
All prototypes are located in a source file named QPROLESRC with the same
name as the source of the module or program
All Copy members for data structures and Reference fields are located in a
source file named QCPYLESRC.
For example
Copy members for references
/If Not Defined (FldRef)
/Define (FldRef)
D FldRef E DS ExtName(DWFldRef) Based(DummyPtr)
/EndIf
/If Not Defined (RefDSMyFile)
/Define (RefDSMyFile)
D RefDSMyFile E DS ExtName(MyFile) Based(DummyPtr)
/Endif
Prototype 1
/Include QCPYLESRC,FldRef
/Include QCPYLESRC,MyFile
/If Not Defined (MyProc)
/Define MyProc
D MyProc PR
D Parm1 Like(FldRef.MyField1) const
D Parm2 LikeDS(RefDSMyFile) Const
/Endif
/If Not Defined MyFct
/Define MyFct
D MyFkt PR Like(FldRef.MyFieldY)
D Parm1 Like(FldRef.MyFieldx) Const
/EndIf
Prototype 2
/Include QCPYLESRC,FldRef
/Include QCPYLESRC,MyFile2
/If Not Defined (MyProc2)
/Define MyProc2
D MyProc2 PR
D Parm1 Like(FldRef.MyFieldA) const
D Parm2 LikeDS(RefDSMyFile2) Const
/Endif
Program/Module
D/Include QPROLESRC,Proto1
D/Include QPROLESRC,Proto2
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 Jon Paris
Gesendet: Wednesday, 23. September 2009 21:41
An: rpg400-l@xxxxxxxxxxxx
Betreff: Re: Problem with non QUALIFIED DS
In the OPs case though Duane this wouldn't have helped. he wasn't
copying the entire prototype file twice - he had a DS that was
duplicated inside multiple different prototype files. That's why I
had the conditionals embedded in the copy member.
Jon Paris
www.Partner400.com
www.SystemiDeveloper.com
On 23-Sep-09, at 2:41 PM, rpg400-l-request@xxxxxxxxxxxx wrote:
I disagree with Jon, I use only one set of compiler directives, if
the copybook name is "RCS0000" and thus the name of the service
program is RCS0000 in my environment, the compiler directives would
look like:
As an Amazon Associate we earn from qualifying purchases.