CNS CICS TERMIDs and VTAM NETNAMEs

The information on this page is intended to describe the difference betweed a CICS Terminal Identifier (TERMID) and a VTAM NETNAME in the CNS environment and to discuss the proper use of each.


Definitions

CICSplex:

TERMID:

NETNAME:

AUTOINSTALL:


History

The original naming convention for TERMIDs in CICS regions at CNS was to use the last four characters of the NETNAME as the TERMID. This implied that the VTAM administrator had to insure that not only was the NETNAME unique within VTAM, but that the last 4 characters of any NETNAME was also unique within VTAM. This scheme worked well for many years.

With the advent of virtual terminals, terminal session managers (such as TPX), and the increasing popularity of TCP/IP and TN3270, it has become almost impossible to insure the uniqueness of the last 4 characters of the VTAM name. Given the increasing number of terminal definitions in VTAM which are required to support today's environment, insuring uniqueness of the 8-character NETNAME will eventually be all that is possible in VTAM.

CICS TERMID uniqueness must still be maintained, however. In order to accomplish this, the terminal autoinstall program was modified to use a new algorithm where the 4 character TERMID does not bear any relationship whatsoever to the 8 character NETNAME of the device. In addition, the TERMID will not (necessarily) be the same across a logoff/logon because the TERMIDs are chosen from a table by selecting the first unused value in the table. The TERMID tables used in the various regions were defined in such a way as to insure uniqueness of TERMIDs within the CICSplex.


Proper Use of TERMID and NETNAME

TERMID and the START command

One of the most common uses of TERMID in CICS applications is for printing. Many applications START a transaction to the TERMID associated with the desired printer. At CNS, all printers are pre-defined to CICS and have fixed TERMIDs associated with them. Since these printer devices are pre-defined to CICS, they are not affected by the terminal autoinstall algorithm. The TERMID and NETNAME for these devices will remain constant.

Frequently applications will START a transaction back to the same terminal on which the program is currently running. This is a common practice in many MENU type applications, for example. In the past, this was a recommended practice which worked well in MRO environments. When doing this, the TERMID placed in the START command should be picked up from the field EIBTRMID which is provided by CICS. Some applications in the past may have been coded to pick off the last 4 characters of the NETNAME field and use that as the TERMID for these START commands. These applications required modification to correctly pick up the TERMID from EIBTRMID when the autoinstall algorithm used at CNS was changed. Although it may have worked in the past, using NETNAME to construct TERMID in an application has never been correct programming practice. TERMID has always been defined in CICS as a distinctly different field from NETNAME.

Use of the START command to invoke a new transaction back at the same terminal is no longer necessary thanks to a new facility introduced in CICS/ESA. Current releases of CICS now provide a RETURN IMMEDIATE command as an alternative to doing STARTs back to the same terminal. CNS recommends the use of RETURN IMMEDIATE over START in these cases. There is a discussion of the advantages and implications of using RETURN IMMEDIATE in the section of this web site which contains general tips for CICS application programmers.

Regardless of whether the device is pre-defined or defined at autoinstall time, never assume the ability to derive the TERMID from the NETNAME. Use the TERMID fields provided by CICS instead.

Security by TERMID or NETNAME

In the early days of CICS at CNS, many application developers used the CICS TERMID as a means of restricting access to an application. This was fine in the days of real 3270 terminals and control units with fixed names that never changed. However, in today's environment in which most of the NETNAMEs are for virtual devices (such as TCP/IP and TN3270 sessions or TPX sessions), security by TERMID will not work in most cases. Another reason that security by NETNAME or TERMID will not work in many cases is the fact the ASSIGN NETNAME command will only return the NETNAME of the terminal if the program which issues the ASSIGN command is running in the region that owns the terminal (TOR). In an AOR, the ASSIGN NETNAME command returns binary zeros. Given the complex environment of interconnected regions today, applications should be coded so that they will work properly regardless of whether they are running in a TOR or an AOR. The recommended way to secure applications is through the use of the USERID of the signed on user. CNS discourages any use of security by TERMID or NETNAME in CICS.

TS Queue names

The CICS TERMID is frequently used in constructing the names for temporary storage queues in CICS. This is not a problem as long as the temporary storage queue is only used during a single terminal session (between LOGON and LOGOFF). Since the TERMID (and in some cases NETNAME) can change during a LOGOFF and subsequent LOGON, queues whose names are based on these fields would no longer be associated with the specific device. If the existence of the queue is only required during the terminal session, the use of TERMID to construct temporary storage queue names is perfectly valid; however, be sure to base the name on EIBTRMID (not the last four characters of NETNAME).

Not only is using the TERMID to construct temporary storage queue names valid in many cases, it is recommended whenever possible. The reason for this is that using the TERMID to construct names for queues makes it easier to code routines to clean up (delete) temporary storage queues when a terminal user logs off or the session is broken abnormally. CNS provides a facility whereby an application developer can code a routine to search for and delete any temporary storage queues associated with a terminal and have it invoked at session termination time. CNS strongly encourages the use of this mechanism for cleaning up temporary storage queues. Contact the CNS CICS Systems Group for more information on the use of this facility.


Questions, comments, or suggestions regarding this site should be directed to cicsgrp@nersp.nerdc.ufl.edu.

*Back to CNS CICS Home Page *Back to CNS Home Page *Back to UF Home Page

Last updated: April 17, 2006 by Barry Brooks.