I have an array which holds a record from a CSV file. Can I for example use the move statement to move elements 5 to 10 out into working storage? Something like: MOVE ExampleArray(5:10) TO WS-TEST. I have been told this is possible instead of having to loop through the array. But I can not seem to get it to compile this way.
Share
The syntax you are using is called Reference Modification. It is the equivalent of substring() in other languages. Your example code would try to move 10 bytes from ExampleArray+5.
There is a “ALL” subscript concept that is supported. It has limitations, but it MIGHT do what you want. Try something like:
Depending upon your compiler, it MIGHT work. I think the spec limits its use to integer functions, but not all compilers do.
Seriously though, perform loops are very simple and easy, just code this: