Strovent SystemsSign in
Reference

5250 device name already in use: find the old session and free the name

A named 5250 device stays busy while an old job holds it. Sign on again to reconnect, or find the job by its device name and end it, then stop repeats.

You connect with a fixed 5250 device name, such as JSMITH01, and the connection closes before the Sign On display. Or the host tells the system operator that the device is in use. Most of the time the name is still held by your own earlier session, the one that dropped when the Wi-Fi or VPN went away.

A device name belongs to one session at a time. The messages the host logs for this are described in IBM i "Cannot automatically select virtual device" (CPF8940, CPF87D7).

Why the old session still holds the name

When a connection drops without a sign-off, the host does not know at once. The Telnet server sends keep-alive probes to idle sessions. The default timeout is 600 seconds (the TIMMRKTIMO parameter of CHGTELNA). When a session does not answer, the server ends the session and returns its virtual device to the pool.

What happens to the job on that device depends on the system value QDEVRCYACN:

  • *DSCMSG (IBM's recommended value) or *DSCENDRQS: the job is disconnected, not ended. It keeps its place, and the device name stays tied to it.
  • *ENDJOB or *ENDJOBNOLIST: the job ends.
  • *MSG: the error goes to the program in the job, which does its own recovery.

IBM notes that this only affects named devices. For automatically selected QPADEVxxxx devices, the interactive job always ends.

A disconnected job does not wait forever. The system value QDSCJOBITV sets how long a job can stay disconnected before the system ends it. Disconnected jobs also end when their subsystem ends or at an IPL.

Get back into the same job

Connect again with the same device name and sign on with the same user profile. The system reconnects you to the disconnected job instead of starting a new one. With *DSCMSG, the program in that job gets an error message when you sign on again and handles it. With *DSCENDRQS, the job is returned to its last request level. The program, menu and current library you type on the Sign On display are ignored when you reconnect.

Until the keep-alive timeout has passed, the server can still count the old session as live, and the name is refused. Wait for the timeout, then connect again.

Find the job that holds the name

For an interactive job, the job name is the device name. So the job you are looking for is called JSMITH01, with your user profile and a six-digit job number.

  1. From any session that works, run WRKACTJOB.
  2. Press F14 (Include). Disconnected jobs are hidden until you do.
  3. Look for the job with your device name. F7 searches the list.

Option 4 ends the job. You can end a job that runs under your own user profile. Ending another user's job needs job control (*JOBCTL) special authority, so ask the administrator.

Stop it happening again

  • Give each phone, tablet and PC its own device name, for example JSMITH01 and JSMITH02, so two of your sessions never ask for the same name.
  • Sign off with SIGNOFF before you close the session or put the device away.
  • If you do not need a fixed name, leave it empty. The host then picks a free QPADEVxxxx device for each connection.
  • If you also see a second sign-on refused for the same user, that is a different limit: see Why IBM i refuses a second sign-on (QLMTDEVSSN).

An administrator can shorten the keep-alive timeout, change QDSCJOBITV, or choose a QDEVRCYACN value that ends jobs instead of disconnecting them. Those are site decisions.

Sources

Spotted a mistake? Email [email protected].