Q: My application uses a display record format with I/O fields in which errors could occur, based on the data entered in those fields. When one or more errors occurs, the message subfile displays the errors on line 24. When there is more than one message in the subfile, the user can only scroll through messages in the subfile if the cursor is on line 24. How can I cause the cursor to automatically be positioned on line 24 when an error occurs?
A: Use the cursor location (CSRLOC) display-file keyword to force the cursor to line 24 anytime an error occurs. Condition the CSRLOC keyword with an indicator that your program sets on when an error occurs.