Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Name or Entry Already Defined on a Definition" Error

Status
Not open for further replies.

Fooch

Programmer
Dec 19, 2005
63
US
I am building a Data Structure with multiple data structures in it. Need it to pass parms to a procedure. The issue is I don't understand why I am getting these error. It may just be something stupid and I am just fried. Anyway, Here is the DS:

D @FullLcDS DS
D @FullLcPfP Like(@FullLcPf)
D @FullLcEqP Like(@FullEq)
D @FullLcFfP Like(@FullFf)

This first field is the issue. Here is the External Data Structure and the pointer.

D @FullLcPf E DS ExtName(PLTLCD)
D Based(Ptr@FullLc)
D Ptr@FullLc S * Inz(%Addr(@FullLcPfP))

The issue comes up because of these lines of code down further that were there from the client and shouldn't be moved. It is a quick change and don't have the time to re-write the whole thing.

D DS
D LCDD01 1 11
D LCDD02 12 22
D LCDD03 23 33
D LCDD04 34 44
D LCDD05 45 55
D LCDD06 56 66
D LCDD07 67 77
D LCDD08 78 88
D LCID 1 88
D DIM(8)

All these fields are in the file that the external data structure is based on. I tried deleting the "from to" fields because the program should know the length...but same errors. I find it hard to believe that if you make an external DS off a file that you can't make any other Data structurs off the fields from that file. Anyone have any idea why I am throwing these errors? Your help would be GREATLY appreciated.
 
I may have an idea...i could just Prefix the external DS. I will try that out...but even if it does work...why wouldn't it work before? I think that is pretty bad if RPG couldn't handle that.
 
If a variable is declared as a subfield of a data structure, you can't have it as a standalone field or as a subfield of another data structure. You can, as you pointed out, use the PREFIX keyword (QUALIFIED might also work).

Feles mala! Cur cista non uteris? Stramentum novum in ea posui!

 
Thanks for the explination and the prefix did work...thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top