Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
You can do what you want using reference modification.
Define a variable that will be the displacement into the data area (i.e. 77 DSPL PIC 999 COMP-3 VALUE ZEROS.).
Set up a loop that moves the starting position (x) to dspl,
compares the current position to 'M=" (i.e. IF DATAAREA(DSPL:2) = 'M='),
and increments DSPL until end-of-data is reached (y - 2) or 'M=' is found.
If 'M=' is found, use the byte after the "=". If 'M=' is not found, do whatever is appropriate.