ch17.bodyTEXTDmWrH#Bs>[y*mBIN Naming Conventions

In order to record the libraries, programs and maps in use, applications will find it necessary to apply some form of basic naming standards. These names and conventions should be controlled by the Data Administrator or Data Manager.

Library Names

The names of NATURAL libraries should be four characters in the form XAAA, where "X" is a one character Application type: Development, User Test, Acceptance, or Production. "AAA" is a three character system code.

Object Names

All objects should be named using the following convention:

XXXnnnOY

where:

XXX = System Identifier
nnn = Program Identifier
O = Object Type
Y = Sub-Qualifier

Object Types should be selected from the following list:

P = Program
N = Subprogram
S = Subroutine
H = Helproutine
M = Map
F = Form/Report
G = Global Data Area
L = Local Data Area, Working Variables
V = Local Data Area, File Views
I = Local Data Area, Screen Variables
A = Parameter Data Area
X = Helptext
C = Copycode

You may need to consider extensions to this list since it only covers our current environment. We would consider, later, Command Processors, Recordings, COPYCODE, and documentation (stored on PREDICT by modifiable from NATURAL.)

Program Names

Online programs XXXnnnPs

Batch programs XXXnnnBs

Where nnn = Program Sequence Number and 's' = Module Sub-sequence Number or Version.

The program sequence number should be unique within System /Online or System/Batch although it may be more meaningful if it could be unique within the System. So it is perfectly acceptable to have XXX001P and XXX001B providing they serve the same function.

For batch programs, the sequence number should be used to indicate some internal business function,that is, program XXX260B to XXX269B all relate to a similar function.

When one map or object is modified yet provides basically the same function, the Sub-sequence Number may be applied. FIM003M0 provides an input screen with a selectable option for extended display of employee information; the overlay is stowed as FIM003M1.

Subroutine Names

XXXnnnSy

Where nnn = Sequence Number or Program Number if this is meaningful and 'y' is a Sequence Number to allow more than one per program if it is an integral part of a higher level program.

A subroutine by it's very nature is likely to be used from many places, so it cannot be tied back to any particular program. If this is the case, the sequential number (starting at 001) should be assigned as the identifier.

If however the subroutine is an integral part of a higher level program, then the identifier should be the program number.

Subprogram Names

XXXnnnNy

Where nnn = Sequence Number or Program Number if this is meaningful and 'y' is a Sequence Number to allow the naming of more than one per program if it is an integral part of a higher level program.

A subprogram by it's very nature is also likely to be used from many places, so it cannot be tied back to any particular program. If this is the case, then a sequential number (starting at 001) should be assigned as the identifier.

If however the subprogram is an integral part of a higher level program, then the identifier should be the program number.

These are programs that are "called" using the CALLNAT statement. (CALLNAT cannot be used with any other object-type). Parameters may optionally be passed to the called subprogram which may be marked as read-only or modifiable.

The subprogram called must start with a DEFINE DATA PARAMETER statement defining the structure of the parameter list if present. The number, format, and length of the parameters in the calling program must match exactly the number of receiving fields in the DEFINE DATA PARAMETER structure. The rank and dimension of arrays in the passed parameter list must also match exactly. The Parameter Data Area previously defined should be used in both the "called" and the "calling" programs. The CALLNAT statement may be used in a program, subroutine (internal or external) or another subprogram.

A Global Data Area available to the calling program is not available to the subprogram. The subprogram may create its own Global Data Area which is then available to subsequent modules invoked via FETCH or PERFORM statements.

Helproutines

XXXnnnnHy

Where nnn = Program Number related to the helproutine and 'y' is a sequence number allowing more than one helproutine available per program. These are program-like modules that are invoked from within a program or map:

Via a Program Function key designated as HELP and positioning the cursor in anywhere in the field

By typing a question mark in a field to which the helproutine has been attached in the first position of the field

By invoking the helproutine (HE= assigned to the field) by way of:

REINPUT USING HELP MARK FIELD *fieldname

The name of the helproutine is included in the extended editing of a specific field. It normally consists of a 'pop-up' window which will overlay the existing screen in a position as near as possible to the position of the cursor when a Program Function key is depressed.

COPYCODE

XXXnnnnCy

Where nnn = numerical designator of the COPYCODE member and 'y' is a sub-qualifier.

COPYCODE is coded in the Program Editor and only saved, never stowed. COPYCODE is INCLUDEd at compilation thus reducing the size of the source object. For this reason, COPYCODE is often not allowed in a application or project definition. However, a little planning can go a long way and COPYCODE does reduce the source size.

COPYCODE can be made "dynamic" through the use of an INCLUDE argument list used to transfer values from the main object to the copycode.

Maps & Forms

XXXnnnMy for Maps related to online programs

XXXnnnFy for Forms related to batch programs

XXXnnnXy for Helptext related to online programs

Where nnn = Program number related to the map, helptext, or form and 'y' is a sequence number allowing more than one map, helptext, or form per program.

All maps should be defined using the Map Editor and are to be invoked with the INPUT USING MAP statement. The maps can be defined as being up to 250 columns by 250 lines (there are buffer limitations), but they should be restricted to no more than 80 columns and 24 lines in order that they can be displayed at most terminals. Smaller map sizes can be defined for use with the DEFINE WINDOW statement.

All report layouts, where possible and practical, should be defined using the Map Editor and be invoked with the WRITE USING FORM statement. The map/form size should be set to the standard paper size of 132 columns and 66 lines per page.

For more detailed information, see Output Standards section.

Helptext

XXXnnnXy

Where nnn = Map (program) Number related to the map/program and 'y' is a sequence number allowing more than one helptext per program.

All helptext must be defined using the Map editor and invoked in the same manner as helproutines. Similar to many helproutines, it is a 'pop-up' window which will overlay the existing screen in a position one line under and in the same column as the first position of the field for which it is invoked. If the 'window' cannot fit in the default position, NATURAL will place it in the same plane as the first column of the field at the upper portion of the screen.

Data Object Types

All data areas should be defined using the Data Area Editor and stored externally to the program.

Global Data Areas

XXXnnnGy

Where XXX is the application/project the GDA is assigned to.

The Global Data Area will act in a similar capacity to the use of the existing concept of Global Variables. It should contain:

A GDA should not be divided into 'data blocks'.

All changes to a GDA should be authorized by the Data Administrator as all previously written programs using that GDA will require re-cataloging.

Parameter Data Areas

XXXsssAy

Where sss is related to the subprogram number.

A Parameter Data Area should be defined for each subprogram that is used within the application.

It should be defined externally by the Data Editor and stored independently from the subprogram.

The PDA may be used as an LDA in the 'calling' program.

Local Data Areas

XXXpppLy

XXXnnnVy

XXXmmmIy

Where ppp = program number; nnn = sequence number; mmm = map number.

Local Data Areas are split into three categories:

Data Variables

Optionally, all data variables should be named using the following conventions:

Global #G-

Parameter #P-

Local, Views Database Field Names

Working #W- (Temporary or Working-Storage type variables generally referred to as User-Defined Variables)

Maps #M-

Indices #I-

Application Independent Variables

Self documenting since they must begin with a plus sign.

Labels

Xvvvvnn.

When employing labels, use an eight character name: seven characters followed by a period (required) where:

X indicates the access/loop statement to which the label is attached:

R = READ
F= FIND
G= GET
H = HISTOGRAM
S = SORT
R = REPEAT (see below)
F = FOR

vvvv = first four characters of the view name or a variation of the view name that conveys the database file accessed; when used for REPEATs, this should help identify the loop in a unique fashion.

nn = sequence number; 1 is always coded 01, etc.

 

2f333333333f333f3̙f3f3ffffff3f3333f333f3wUD"wUD"wUD"ݻwwwUU Dreamweaver28A2STR