Disconnect/reconnect feature
When an EXEC tries to reconnect a session, it is important that you check the condition code (IMFCC) after the IMFEXEC LOGON command. Reconnect sometimes fails due to applications terminating OSPI sessions when no activity occurs within a specified time. If IMFCC indicates that a reconnect is not successful, you must reestablish a new session.
To make use of the DISCONNECT/RECONNECT feature, the EXEC that initially establishes the session must store the session identifier (contained in the OSISESS variable) in a shared variable. This variable can then be retrieved by subsequent EXECs to reconnect. A unique shared variable name must be used for each different session that is concurrently maintained.
If an EXEC does not issue an IMFEXEC LOGOFF command, all sessions are automatically terminated. The result is the same as if explicit IMFEXEC LOGOFF commands had been issued for each session.