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



You need more groups....

D ds_example DS Qualified
D Geo
D State 2s 0 Overlay(Geo)
D County 3s 0 Overlay(Geo: *next)
D City 4s 0 Overlay(Geo: *next)
D 3s 0 Overlay(Geo: *next)
D Geo2 Overlay(Geo: 1)
D Npa 3s 0 Overlay( Geo2)
D Nxx 3s 0 Overlay( Geo2: *next )
D 6a Overlay( Geo2: *next )


Global Field References:
Field Attributes References (D=Defined M=Modified)
*INLR N(1) 002500M
DS_EXAMPLE DS(12) 001300D
CITY S(4,0) 001700D
COUNTY S(3,0) 001600D
GEO A(12) 001400D
GEO2 A(12) 001900D
NPA S(3,0) 002000D
NXX S(3,0) 002100D
STATE S(2,0) 001500D

Note the DS is only 12....



Also...why not use DS subfields?
D Geo_t ds based(template) qualified
D State 2s 0
D County 3s 0
D City 4s 0
D 3s 0

D Geo2_t ds based(template) qualified
D Npa 3s 0
D Nxx 3s 0
D 6a

d ds_example2 ds qualified
d geo likeds(geo_t)
d geo2 likeds(geo2_t) overlay(geo)


DS_EXAMPLE2 DS(12)
GEO DS(12)
GEO2 DS(12)
GEO_T DS(12)
BASED(TEMPLATE)
CITY S(4,0)
COUNTY S(3,0)
STATE S(2,0)
GEO2_T DS(12)
BASED(TEMPLATE)
NPA S(3,0)
NXX S(3,0)


HTH,
Charles

On Fri, Apr 15, 2011 at 2:37 PM, Kurt Anderson
<kurt.anderson@xxxxxxxxxxxxxx> wrote:
I was coding a Data Structure, and the Overlay's *next option did not work as I expected it to.  I have to assume it's working as designed, but I wanted to mention what I encountered and see what others thought.

Essentially, I had (wrongly) thought that once you specify an Overlay with a position number, that any *next that follows will be based on that position.  Why?  Because that's how it works when the first Overlay specifies a position.

The code that doesn't work:
    D ds_example      DS                  Qualified
    D  Geo                          12a
    D   State                        2s 0 Overlay( Geo: 1 )
    D   County                       3s 0 Overlay( Geo: *next )  //starts in position 3 of Geo
    D   City                         4s 0 Overlay( Geo: *next )
    D   Filler1                      3s 0 Overlay( Geo: *next )
    D   Npa                          3s 0 Overlay( Geo: 1 )
    D   Nxx                          3s 0 Overlay( Geo: *next ) //expected to start in position 3, however ---> Error, Geo not large enough.
    D   Filler2                      6a   Overlay( Geo: *next )


The code that does work:
    D ds_example      DS                  Qualified Static
    D  Geo                          12a
    D   State                        2s 0 Overlay( Geo: 1 )
    D   County                       3s 0 Overlay( Geo: *next )
    D   City                         4s 0 Overlay( Geo: *next )
    D   Filler1                      3s 0 Overlay( Geo: *next )
    D   Npa                          3s 0 Overlay( Geo: 1 )
    D   Nxx                          3s 0 Overlay( Geo: 4 )
    D   Filler2                      6a   Overlay( Geo: 7 )

This is only the beginning of the data structure.  There is actually more overlaying going on afterward as well.

Thanks,

Kurt Anderson
Sr. Programmer/Analyst
CustomCall Data Systems

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