CICS abend

ATNI: Task abended after a terminal error

An ATNI abend means a terminal or session error happened while a task was attached to the terminal, and the node abnormal condition program (DFHZNAC) told CICS to abend the task. The error itself is reported in DFHZC messages in the CSNE log.

Other names for this code

Also written as ATNI abend, CICS ATNI, abend ATNI, abendATNI, ATNI TERMERR, ATNI DFHZNAC.

What it means

For terminals connected through VTAM, CICS terminal control hands every session error to DFHZNAC. That covers a lost session, an unbind, a protocol error or a terminal that was switched off. DFHZNAC decides what to do about the error, writes DFHZC messages describing it, and calls the node error program (DFHZNEP). A site can write its own NEP to change the actions DFHZNAC takes.

One possible action is ABTASK, which abends the task using the terminal. If a task is attached to the terminal when that action is taken, CICS raises the TERMERR condition on the task's current or next terminal control request. A program can handle TERMERR and clean up. If it doesn't, the task ends with ATNI.

So ATNI doesn't point at a bug in the program. It tells you the terminal went away, or misbehaved, while the task was still using it. The details of what went wrong are in the DFHZC messages written at the same time.

Common causes

  • A user closed the emulator window, or lost their network connection, while a transaction was running or waiting for input at that terminal.
  • The session was lost in the network, for example when a link failed or an operator deactivated the logical unit.
  • A terminal or emulator broke the SNA protocol, and the session was ended with a sense code.
  • A site-written node error program asked for ABTASK on errors where the default actions would have left the task alone.

How to find the problem

  1. Look in the CSNE transient data log for DFHZC messages at the time of the abend. They name the terminal ID and network name and usually give an SNA sense code.
  2. Message DFHZC3437I lists the actions DFHZNAC and the node error program took for the error.
  3. Find the DFHAC message for the abend in the region's message log to confirm the transaction and terminal.
  4. Check the z/OS console and network logs for messages about the same logical unit at the same time.
  5. Ask whether your region uses its own DFHZNEP, and if so, what it does for that error.

How to fix it

  • Use pseudo-conversational design. A task that ends after each screen holds nothing while the user thinks, so a dropped session between screens abends nothing.
  • Fix the network or emulator problem shown by the DFHZC messages and sense codes.
  • In programs that need to tidy up when the terminal fails, handle the TERMERR condition. IBM notes this doesn't replace a node error program, which handles session-level problems.
  • Review the node error program's actions for the error if the ATNI abends started after it was changed.

IBM documentation

IBM CICS documentation. Use the documentation for your installed release.

This link opens the relevant IBM reference library or lookup instructions. Match the complete code and your installed product release; it is not a code-specific review.

Report a correction to WND Software.

Questions

Why did a user get ATNI by closing their emulator?

Closing the emulator ends the session. If a transaction was attached to that terminal at the time, DFHZNAC can abend it with ATNI, because there's nobody left to talk to.

Where do I find the reason for an ATNI?

In the DFHZC messages DFHZNAC writes to the CSNE transient data log at the same time. They name the terminal and describe the error.

Can a program avoid ATNI?

It can handle the TERMERR condition and clean up before ending. It can't keep using the terminal, because the session is gone.