ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Constant Area

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

  • Constant Area

    Hi all

    Can I build a constant array with data in like:

    Code:
    D Status          c             10    dim(4)                     
    D                                     const('A' 'B' 'C' 'D')

    So that the first element hold ?A? second ?B??



    Or do I have to make a compile time table with CTDATA placed in the other end of my program?


    Regards,

    Bent

  • #2
    Re: Constant Area

    Hi,

    you cannot define a constant in this way, but you can do the following:
    PHP Code:
    D DSStatus        DS                                            
    D                               10A   Inz
    ('A')                  
    D                               10A   Inz('B')                  
    D                               10A   Inz('C')                  
    D                               10A   Inz('D')                  
    D   Status                      10A   Overlay(DSStatusDim(4
    It's not quite the same because the array elements can be changed (by hazard).

    Birgitta

    Comment


    • #3
      Re: Constant Area

      Thanks Birgitta

      I will use that solution and I will try hold my finger away from the fields

      Bent

      Comment

      Working...
      X