READ will read the disc entry and return it as a Dynamic Array . MATREAD will read the record from disk and return it as a Dimensioned Array .
So, the real trick is to determine which type of array is more applicable for your use case.
A Dynamic Array is essentially a string that uses specific byte markers to delimit each element (attribute / ambiguity / subcomputation). It is extremely easy to use, does not require prior declaration or sizing. On the other hand, if it can be slower than Dimensioned Array , mainly for large records, or when you randomly extract attributes from an array - O (n log n), I think. Sequential access is optimized and close to Dimensioned Arrays speed.
A Dimensioned Array is essentially an array of strings (or Dynamic Arrays in the case of UniVerse). It reads each attribute into an array position. Each position of the array will consist of a Dynamic Array only for positions with many / sub-currencies of this attribute. Dimensioned Arrays required you to declare them and the number of array positions in advance. Depending on the taste you are using, this can lead to a runtime error if you try to read a record with more attributes than the size of the array. O (1), on the other hand, retrieves attributes from an array regardless of your access pattern.
source share