Is it possible to move alphanumeric field to an array?

Hi,

In my program, I am reading a work file and moving(MOVE BY NAME) into into a ADABAS file.
In the work file, there is a alphanumeric field A10 that I want to move into an array field(A10/1:15) of an ADABAS. Directly it won’t be possible to move from alphanumeric to array filed. To resolve this issue, I changed the variable name in the work file, so that it will skip that filed and later I am moving it explicitly into the first occurrence of any array.
eg.

DEFINE DATA
LOCAL
01 #WORK01
02 X1 (A10)

01 ABC VIEW OF ABC
02 X (A10/1:15)

END-DEFINE

READ WORK 01 #WORK01
MOVE BY NAME #WORK01 to ABC
MOVE #WORK01.X1 TO ABC.X(1)
.
.
.
.

Here, I am moving into first occurrence of an array. This ADABAS records will move to log file with move by name in the object routine, and I think there is some problem while moving alphanumeric filed into first occurrence of ( A10/1:15) and the same array field is moving into the another array filed of (A10/1:15).

Can someone please help me to resolve this problem?

Please read the Natural reference manual and learn what MOVE BY NAME actually does.
It would appear from what you posted that the MOVE BY NAME will not be moving anything. For something to actually get moved you would need structures such as:
DEFINE DATA
LOCAL
01 #WORK01
02 X1 (A10)

01 ABC VIEW OF ABC
02 X1 (A10)

Natural looks for variable names that are identical in both Groups (#WORK01 and ABC, both of which are groups). It does not appear you have any matches, hence nothing will be moved.

You might read up on MOVE BY POSITION, which might meet your requirements.

I presume that you don’t want the scalar value to fill the array.

DEFINE DATA LOCAL
1 #WORK01
  2 X (A10)        INIT <'scalar'>
  2 A (A1)         INIT <'a'>
  2 N (N1)         INIT <1>
1 ABC
  2 X (A10/1:5)   INIT <'array1', 'array2'>
  2 A (A1)
  2 N (N1)
END-DEFINE
MOVE BY NAME #WORK01 TO ABC
DISPLAY #WORK01
        ABC
END

    #WORK01           ABC
 
    X      A N      X      A N
---------- - -- ---------- - --
 
scalar     a  1 scalar     a  1
                scalar
                scalar
                scalar
                scalar

MOVE BY NAME will work if you redefine the array so that the first entry has the same name as the renamed scalar in the WORK file.

DEFINE DATA LOCAL
1 #WORK01
  2 X1 (A10)       INIT <'scalar'>
  2 A (A1)         INIT <'a'>
  2 N (N1)         INIT <1>
1 ABC
  2 X (A10/1:5)    INIT <'array1', 'array2'>
                   2 REDEFINE X
    3 X1 (A10)                    /* <-- scalar
  2 A (A1)
  2 N (N1)
END-DEFINE
MOVE BY NAME #WORK01 TO ABC
DISPLAY #WORK01
        ABC
END
 
    #WORK01           ABC
 
    X1     A N      X      A N
---------- - -- ---------- - --
 
scalar     a  1 scalar     a  1 
                array2

The results above will make more sense when viewed with a fixed font.