Thanks, Simon, for the very helpful suggestions! I’ll consider using ACCEPT START-TIME FROM MICROSECOND-TIME to measure time directly in Cobol, avoiding the need for additional C++ code. Regarding using an index and performing SORT WS-ARRAY directly, that’s indeed the standard way—I wanted to try implementing the same logic as in other examples, but it seems the result isn’t correct.
I’d like to ask: is there something wrong in my code that causes the array not to sort correctly? I entered the numbers and performed the SORT, but the output still doesn’t appear in ascending order as expected.