ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Using Extname overlay(xxx : *next) doesn't work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Extname overlay(xxx : *next) doesn't work

    Hi All:

    This works:
    Code:
         d grprte        e ds                  extname(grouprate)     
         d   ages                              [COLOR=#0000ff]overlay(grprte : 22)[/COLOR]  
         d                                     like(aghi1) dim(14)    
         D                                     ASCEND                 
         d   RTES                              [COLOR=#0000cd]overlay(grprte [/COLOR]:[COLOR=#ff0000] 50[/COLOR])   
         d                                     LIKE(RATE1)     DIM(14)
    This doesn't work:
    Code:
         d grprte        e ds                  extname(grouprate)     
         d   ages                              [COLOR=#0000cd]overlay(grprte : 22)[/COLOR]   
         d                                     like(aghi1) dim(14)    
         D                                     ASCEND                 
         d   RTES                              [COLOR=#0000cd]overlay(grprte :[/COLOR] [COLOR=#ff0000]*next[/COLOR])   
         d                                     LIKE(RATE1)     DIM(14)
    RTES is all zeros.
    Can anyone see what I'm doing wrong?

    < e d i t > I'm at v6r1 < / e d i t >

    Thanks
    GLS
    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

  • #2
    Re: Using Extname overlay(xxx : *next) doesn't work

    Try using pos(50) instead of overlay. I think Barbara Morris's comment #7 in the following thread might be what you are looking for.

    Comment


    • #3
      Re: Using Extname overlay(xxx : *next) doesn't work

      POS is only valid for free-form definitions.

      OVERLAY(grprte:50) is the way to do this in fixed form, even if you are at 7.1 and have the free-form update.

      Comment


      • #4
        Re: Using Extname overlay(xxx : *next) doesn't work

        POS in free format can only be used for overlaying complete data structures, while the OVERLAY Key word is not allowed in this situation in free format.
        But for overlaying sub-fields within data structures the OVERLAY key word has to be used.

        Code:
         DCL-DS MyDataStructure Qualified Inz;
                  Subield1 Char(10);
                  Subield2 Char(10);
                  Array    Char(10) Dim(2) Pos(1);
         End-DS;
        
         DCL-DS MyDataStructure Qualified Inz;
                  SubDS;
                     Subfield1 Char(10) Overlay(SubDS);
                     SubField2 Char(10) Overlay(SubDS: *Next);
                     Array     Char(10) Dim(2) Overlay(SubDS);
         End-DS;
        Birgitta

        Comment


        • #5
          Re: Using Extname overlay(xxx : *next) doesn't work

          Thanks to all.
          It makes sense now.

          GLS
          The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

          Comment

          Working...
          X