Previous Topic

Next Topic

Book Contents

Book Index

Naming Variables

Variables are automatically part of the group in which they were created. Their names should therefore reflect their function within the group. Variable names can be up to 20 characters.

Because you can potentially create a very large number of variable names, it is important that you using naming conventions that can help you readily identify a variable. The following are some general suggestions for naming variables:

Here are some examples:

VARIABLES, With a Prefix or Suffix of a Division or Department Code

Assume that you are defining a balancing application, and want to store data in the Control-M/Analyzer database, and segregate that data by division. You will also typically retrieve, review, and update the data by division. This is similar to how the rules in Chapter 2 are defined.

There are two possible naming conventions:

Some examples are:

D001_COST               COST_001

D002_COST               COST_002

D003_COST      or       COST_003

D001_SALES              SALES_001

D002_SALES              SALES_002

D003_SALES              SALES_003

The issue of which convention is better can be determined when you answer the following questions:

In the first case, the division code as a prefix is better. In the latter case, the suffix approach is more helpful.

VARIABLES, Associated with an "Owner"

Many organizations attach each variable to an "owner," meaning either the department or job title responsible for maintaining the data. Some examples are:

PURCH_SUPPLIES

PURCH_CAPITAL

PERSNL_SALARIES

PERSNL_BENEFITS

In these examples, the two departments, PURCH (Purchasing) and PERSNL (Personnel), each "own" their respective variables. This naming convention may be better handled by creating separate groups for the purchasing and personnel departments, and eliminating the department prefix from the variable name.

While naming convention possibilities are extremely flexible, it is important to adopt them from the beginning. It is much easier to define variables once, and not have to redefine them later.

Parent Topic

Suggested Conventions