Multiple Concurrent IUI Sessions
It is possible to have one IUI session per ISPF logical screen. To start the first IUI session, you might use a script similar to the one below.
/* REXX */
ARG NETMAP APPL
IF NETMAP = '' THEN NETMAP = “CDA.NETMAP”
IF APPL = '' THEN APPL = “CDA”
ADDRESS TSO
“ALLOC F(DMMSGFIL) DA(’$CD.MSG’) SHR REUSE”
“ALLOC F(DMPUBLIB) DA(’$CD.SDGAPROC’) SHR REUSE”
“ALTLIB ACTIVATE DATASET(’$CD.SDGAISPC’) APPLICATION(CLIST)”
ADDRESS ISPEXEC
“LIBDEF ISPLLIB DATASET ID('$CD.SDGALINK’) STACK”
“LIBDEF ISPMLIB DATASET ID('$CD.SDGAMENU’) STACK”
“LIBDEF ISPPLIB DATASET ID('$CD.SDGAPENU’) STACK”
“LIBDEF ISPSLIB DATASET ID('$CD.SDGASENU’) STACK”
“SELECT PGM(DGADISTR) PARM(“netmap”) NEWAPPL(“appl”) PASSLIB”
ADDRESS TSO
“FREE F(DMMSGFIL DMPUBLIB)”
“ALTLIB DEACTIVATE APPLICATION(CLIST)”
ADDRESS ISPEXEC
“LIBDEF ISPLLIB”
“LIBDEF ISPMLIB”
“LIBDEF ISPPLIB”
“LIBDEF ISPSLIB”
EXIT 0
Invoked with no arguments and no other IUI sessions active in the TSO LOGON, the IUI is started
with the default netmap and applid, and when exited, cleanup is complete and leaves the TSO session
in the same state as before the REXX EXEC was invoked. The LIBDEF and ALTLIB commands are limited in
scope to the ISPF logical screen they are invoked on. But the scope of the TSO ALLOCATE command is
the entire TSO session. So if before exiting, the ISPF SPLIT command is invoked, and the same REXX
is invoked (say, specifying a different netmap DSN) on the second ISPF logical screen, the DMMSGFIL
and DMPUBLIB allocations will be re-done. Since REUSE was specified, the ALLOCATE commands will
complete and both IUI sessions will function properly. But when either IUI session is exited, it
will free DMMSGFIL and DMPUBLIB, effectively pulling the rug out from underneath the other IUI
session. The simplest way to avoid this problem is to remove the FREE command and manually
unallocate them as required.
Note:
ISPF supports up to 32 logical screens. Your installation can reduce that number. Each IUI session requires a certain amount of storage (below and above the line). You may need to increase the TSO user’s region to run multiple IUI sessions. Any ISPF logical screen can be used for any IUI session. You are allowed only one IUI session per ISPF logical screen. If you invoke more than one IUI session on one ISPF logical screen, the results are unpredictable. IUI sessions started with the same ISPF APPLID share the same ISPF profile pool. Each IUI session can utilize multi-session signon.