LMOPEN—open a data set

The LMOPEN service opens the data set associated with a given data ID so the data set can be either read from, using LMGET, or written to, using LMPUT. The LMINIT service must be completed before LMOPEN can be used.

For each LMOPEN invocation, you should invoke a matching LMCLOSE service. The LMCLOSE service closes the data set to further processing until LMOPEN is invoked again for that data set's data ID. Therefore, you should invoke the LMCLOSE service when processing is completed for that data set. Otherwise, unwanted data can be read from or written to the data set.

Note: Some library access services do not require that LMOPEN be executed before invocation (for example, LMCOPY and LMMOVE). See the service description to determine whether LMOPEN should be invoked.

It is the responsibility of the dialog developer to ensure that a data set is opened for output only once. ISPF does not protect against this situation. From the time LMOPEN for output is invoked until LMCLOSE is invoked, there are certain restrictions on what can be done. Do not invoke the EDIT, DISPLAY, or TBDISPL services. Displaying any panel at all may allow the user to edit the already opened data set or invoke a dialog that opens the same data set for output.