Natural Internal Field number

Can I refer to a mapped field by its internal number. I know POS contains a number representing a field in which to put the cursor on.

Can I use this number to set the attributes? If so HOW?
I tried.

#fieldx := #mark
#fieldx-attr := (AD-I)

Of course it did not like fieldx-attr .

Any help would be appreciated

If I don’t do this, then I have to go through a series if decides, and the Mark is set in copy code used by various programs.

This can be done, but most developers would consider the code “too tricky” for production applications.

DEFINE DATA LOCAL
1 #A (A10)
1 #B (A10)
1 #C (A10)
1 #D (A10)
1 #MARK (I4)       1 REDEFINE #MARK
  2 #MARK-B (B4)
1 #ATTRIB (4)           /* Enough entries to hold all fields
  2 #POS (I4)           /* Unique internal identifier
                   2 REDEFINE #POS
    3 #POS-B (B4)
  2 #CV (C)             /* Dynamic attributes
1 #MSG (A25)
1 #I (I4)
END-DEFINE
*
#POS (1) := POS (#A)    /* Identify each field
#POS (2) := POS (#B)
#POS (3) := POS (#C)
#POS (4) := POS (#D)
*
REPEAT
  INPUT (AD=MDLT) WITH TEXT #MSG 
                       MARK #MARK
        #A (CV=#CV(1))            /* Dynamic attributes via CV
     // #B (CV=#CV(2))
     // #C (CV=#CV(3))
     // #D (CV=#CV(4))
  RESET #CV (*)
  DECIDE FOR FIRST CONDITION      /* Determine which field
    WHEN #A <> ' '
         #MARK := POS (#A)
    WHEN #B <> ' '
         #MARK := POS (#B)
    WHEN #C <> ' '
         #MARK := POS (#C)
    WHEN #D <> ' '
         #MARK := POS (#D)
    WHEN NONE
         IGNORE
  END-DECIDE
  /*
  EXAMINE #POS-B (*) FOR #MARK-B GIVING INDEX #I /* Determine which CV
  #CV (#I) := (AD=D CD=RE)                       /* Sample attributes
  COMPRESS NUMERIC 'First entry:'
                   #I
              INTO #MSG
END-REPEAT
END