You have misunderstood how INITIALIZE works. . . From the manual:
When the REPLACING phrase is not specified:
SPACE is the implied sending item for receiving items of category alphabetic, alphanumeric, alphanumeric-edited, DBCS, national, or national-edited.
ZERO is the implied sending item for receiving items of category numeric or numeric-edited.
Basically your code moved zero to your max field.
However, you really don't want to use 40 (if i understand what this is to do). I believe you really want the highest entry used. For example if there are only 25 entries filled in the array, why set the max to 40?