Named counter server overview

CICS® provides an efficient way of generating unique sequence numbers for use by applications in a Parallel Sysplex® environment (for example, to allocate a unique number for orders or invoices). A named counter server maintains each sequence of numbers as a named counter. Each time a number is assigned, the corresponding named counter is automatically incremented so that the next request gets the next number in sequence. Named counters are the Sysplex equivalent of COUNTER in the Common System Area (CSA) of a single region CICS system.

CICS provides a command level API for the named counter facility. See the Application Programming Guide for general information, and the Application Programming Reference for command syntax. A CALL interface makes the named counters available to batch applications; see the Application Programming Guide for details.

A named counter server provides a full set of functions to define and use named counters. Each named counter consists of:

The values are internally stored as 8-byte (double word) binary numbers, but the user interface allows them to be treated as any length from 1 to 8 bytes, typically 4 bytes.

Named counters are stored in a pool of named counters, where each pool is a small coupling facility list structure, with keys but no data. The pool name forms part of the list structure name. Each named counter is stored as a list structure entry keyed on the specified name, and each request for the next value requires only a single coupling facility access.

Warning:
The counters are lost if the coupling facility fails. See the Application Programming Guide for details of recovery techniques.

For information on how to create a list structure for use as a named counter pool, see Defining a list structure.

Named counter structures and servers

Within each MVS™ image, there must be one named counter server for each named counter pool accessed by CICS regions (and batch jobs) in the MVS image. Named counter pools are defined as a list structure in the coupling facility resource management (CFRM) policy. The pool name, which is used to form the server name with the prefix DFHNC, is specified in the start-up JCL for the server.

Figure 55 illustrates a Parallel Sysplex with three CICS AORs linked to named counter servers.

Figure 55. Conceptual view of a Parallel Sysplex with named counter servers
 This diagram shows three AORs in a Parallel Sysplex with named counter servers. They each have a DFHNCMN NC server, which links to the Coupling facility Number counter pool.

Selecting a named counter server

To reference a named counter, an application program can specify either the actual name of the pool in which the named counter is stored, or it can specify a dummy pool selection parameter, which is mapped to the actual pool name by the POOL parameter specified in the options table, DFHNCOPT. This makes it easy to use a different pool (for example, to isolate test pools from production pools) without having to change the pool selection parameter in the application program. To vary the pool used by a CICS region, either load a different copy of the options table from STEPLIB, or use a common options table where the pool name selection is conditional on the job name and CICS APPLID, in addition to the pool name selection parameter. The options table also supports invocation of a user-specified program to select the appropriate pool given the pool selection parameter.

Security

The server must be authorized to access the coupling facility list structure in which the named counter pool is defined; XES checks this. The server must also be authorized to act as a named counter server; AXM checks this. For information on how to define the necessary authorizations see the CICS RACF® Security Guide.

Note:
You cannot control access to individual named counters.

Related tasks

Setting up and running a named counter server
Defining a named counter options table
Defining a list structure
Defining and starting a named counter server region
Controlling named counter server regions
Deleting or emptying named counter pools
Changing the size of named counter pools
Unloading and reloading named counter pools
Dumping named counter pool list structures
[[ Contents Previous Page | Next Page Index ]]