You are on page 1of 37

Ingenium Standards

20th December 2002

At the end of this session, we shall learn


Ingenium - Coding Standards
Batch
Online

COBOL Divisions and naming standards of Variables

Naming Conventions

Copybooks

Programs (Batch/ Online)

P-Steps

S-Steps

Flow files
and more

Why Standards?

Why Standards??

Training
To define expected quality of code to programmers.
Maintainability
To reduce the effort in modifying or enhancing the
system.
Readability
To create code that is quickly and easily understood
allowing for a better understanding of the system.

Flower Box for Program Comments:


**************************************************************************************************
** MEMBER : CSOM9999.
**
** REMARKS: THIS MODULE PERFORMS THE DELETE RECORD FUNCTION
**
FOR THE ABCD TABLE.
**
** DOMAIN

: <domain>

**
**
**
**

***************************************************************************************************
** RELEASE DESCRIPTION
**
**
**
** 6.2
6/28/01 - CTS - Modified program to update handle new process.
**
***************************************************************************************************

Identification Division
This section describes:

Copyright Information

Program-ID

Author

Date-Written

Source-Computer

Object-Computer

Date-Compiled

Installation

Security

Special-Names

Remarks
Program ID

PROGRAM-ID. prog-id.
Other Parameters Shown in overview not Permitted

Data Division
This section describes:
General Rules and Organization - Data Division
Level Numbers
Picture Clauses
Value Clauses
Field Definitions

Naming of Grouped Data Items


Working Storage Variables
Standard
>
>
>
>

Descriptively named data field content.


Data elements must be placed under Logical Grouping Levels
All local WORKING STORAGE items must be prefixed by WS.
Switches and indicators must have Level 88 fields to denote appropriate values.

Example
01 WS-SWITCHES-AND-INDICATORS.
05 WS-CVG-UWGDECN-CHG-IND
88 WS-CVG-UWGDECN-CHG-YES
88 WS-CVG-UWGDECN-CHG-NO

01 WS-COUNTERS.
05 WS-CTR-FILE1
05 WS-CTR-FILE2
05 WS-CTR-RPT-LINES

PIC X(01).
VALUE 'Y'.
VALUE 'N'.

PIC S9(08) COMP.


PIC S9(08) COMP.
PIC S9(08) COMP.

Level Numbers
This section describes:

Level 01 through 49

Level 66

Level 88

Level Numbers Continued


Level 01 through 49
The 01 level items must begin in column eight, with each successive level indented by
four spaces.
There must be two spaces between the level number and the data name.
Level 66
The use of the 66 level RENAMES item is not permitted.
In maintenance, if 66 level items exist, they must be replaced by correct group
definitions
Level 88
Must be used for all data items that have pre-determined values or codes.
The88levelnamesmustreflectthespecifiedfieldvalues.
Theymustalsocontainthenameofthedataitemtheybelongto.
The88levelitemmustbeindentedfourspacesfromthebeginningoftheitemitreferences.
Theremustbetwospacesbetweenthe88andthedataname
Theprogrammingcodemustreferencetheseitemsbythe88levelnamesratherthanbyfield
value

PICture Class
Standard
The PIC abbreviation must be used.
All PIC clauses within an 01 level data grouping, must be aligned on the same
column.
PIC clauses are not permitted at the data group level. Their use is limited to
elementary data definitions.

The format of the data length is at least two digits surrounded by brackets for all
integers, except for output edit fields.
Example
01 WS-DATA.
05 WS-DATA-ITEM1
05 WS-DATA-ITEM2.
10 WS-DATA-ITEM2A
10 WS-DATA-ITEM2B

PIC X(01).
PIC S9(03)V9(02) COMP-3.

01 WS-REPORT-TOTAL-LINE.
05 FILLER
05 WS-REPORT-TOTAL-AMT

PIC X(20).
PIC ZZZ,ZZ9.99.

PIC S9(05)

COMP-3.

Data Constants & Figurative Constants


Standard

Values that control loop processing, table searches, and other values that do not vary must be
defined in the working storage rather than hard-coded in the procedural code.

Example
01 WS-CONTROL-FIELDS.
05 WS-MAX-LINES
PIC S9(08) COMP
VALUE +56.
05 WS-MAX-OPTIONS
PIC S9(08) COMP
VALUE +122.
The following figurative constants must be used rather than their corresponding hard-coded literal
strings:
ZERO

HIGH-VALUES

ZEROES

LOW-VALUES

SPACE

QUOTES

SPACES

Example
05 WS-FIELD-X PIC X(05)
VALUE SPACES.
05 WS-FIELD-9 PIC S9(05) COMP-3 VALUE ZEROES.

Values Clauses
Standard

All VALUE keywords within an 01 level data grouping must be aligned on the same column.

The continuation feature (hyphen in column seven) must not be used. If the entire literal does not
fit on the line, it must be placed on the next line, starting under the data element name.
Alternatively, the literal can be broken into several lines.

The VALUE clause must be used to initialize data fields that will not be altered during the
execution of the program.

The use of the VALUE clause is not permitted for those data fields whose values are altered during
program execution. They must be initialized in the procedural code.
Example
01 VALUE-EXAMPLE.
05 VALUE-LEVEL-05A
PIC X(05) VALUE SPACES.
05 VALUE-LEVEL-05B.
10 VALUE-LEVEL-10A PIC X(07) VALUE 'OPTION '.
10 VALUE-LEVEL-10B PIC X(08) VALUE 'NUMBER 1'.

Paragraph Naming Conventions

Procedure Division

All paragraph names must contain a four digit sequence


number(Online Modules)
Sequence numbers must be assigned in ascending order.
When first assigning sequence numbers, gaps must be left to allow for
future insertion of new paragraph names.
The sequence number must be followed by a descriptive paragraph
name. The name must reflect what the paragraph does, not how it does
it.
All paragraphs must have a corresponding exit paragraph. The exit
paragraph name must match its associated paragraph name, with an X
appended.
Please note the Alignment.
Example
1000-DESCRIPTIVE-NAME1.
PERFORM 1100-PROCESS
THRU 1100--PROCESS-X.
1000-DESCRIPTIVE-NAME1-X.
EXIT.

> All performs should be coded to Perform thru Perform-X.


For example:
PERFORM 7358-0000-MAINLINE
THRU 7358-0000-MAINLINE-X.
Dont code GO TOs to go to the end of any other paragraph
except for the paragraph you are in
Use periods at the end of the sentences within a paragraph.
> Dont use nested IF statements. Use Evaluate instead.
Every IF should have an END-IF .
All statements inside IF should be indented by 4 spaces.
TO inside a paragraph should be aligned.

Copybook Definition
What to Code in Copybooks?

SELECT statements.

FD statements.

Record definitions.

Data definitions passed between programs.

Data definitions that are used by more than one program.

Procedural code that is used by more than one program.

Utility routines that are not contained in separate programs and that can be used by other
programs.
Formatting and Updating Copybooks
All copybooks must consist of the following elements:
Banner of asterisks marking the start of the copybook
The keyword MEMBER followed by the copybook name
The keyword REMARKS followed by a description of the copy member; if the description requires more than
one line, subsequent lines must be indented and aligned for processing copybooks only, the domain with
which the copybook is associated .

Continued..
A change box containing:
change number in columns one through six
date
release
brief description of change or reason for addition
The COBOL code, either data or procedural
A banner of asterisks marking the end of the copybook
When modifying a copybook, the change box must be updated.

Example
********************************************************************************
** MEMBER : copyname
**
** REMARKS: DESCRIPTION OF COPYBOOK LINE 1
**
**
DESCRIPTION OF COPYBOOK LINE 2, ETC
**
**
**
** DOMAIN : XX
**
********************************************************************************
** RELEASE DESCRIPTION
**
**
**
Chg no ** 6.2
COPYBOOK CREATED FOR STANDARDS
**
*********************************************************************************
01 xxxx-POLICY-DATA-REC.
05 xxxx-POL-NO
PIC X(10).
.
.
05 xxxx-LAST-FIELD
PIC X(02).
********************************************************************************
**
END OF COPYBOOK copyname
**
********************************************************************************

P-Steps

Each P-Step file represents an interaction with the INGENIUM server


logic in the form of an individual business function request. P-Step files
contain the individual field definitions and attributes that are used by the
client architecture when communicating with the server logic.
Standard
Each P-Step must contain the associated INGENIUM Business
Function Identifier.
P-Step file names must have the following format and components
Format
aabbbb-c.d
Example
BF0050-P.p
P-Step for Application Control Retrieve (Inquiry) Business Function

Components
Com
p.

Po
s.

Description

Valid Values/Value
Descriptions

aa

1-2

Unique identifier

BF

bbbb

3-6

Business Function
Identifier

Business Function Identifiers.

Separator

Dash

Type identifier

P-Step

Extension separator

Period

10

File extension

P-Step

Business Function

S-Steps
Each S-Step file represents an interaction with a user. S-Step files contain the
individual field definitions and attributes that are used by the client architecture
when communicating with the user interface.
Standard
S- Step file names must be matched to their corresponding HTML page name.
S-Step file names must have the following format and components.
Format
aabbbb-c.d
Example
BF0050-I.s
Input S-Step definition for the Application Control Retrieve (Inquiry) Business
Function
BF0050-O.s
Output S-Step definition for the Application Control Retrieve (Inquiry) Business
Function
ApplicationAnalysis.s
S-Step definition for Application Analysis

Components
Com
p.

Po
s.

Description

Valid Values/Value
Descriptions

aa

1-2

Unique identifier

BF

bbbb

3-6

Business Function
Identifier

See Business Function


Identifiers.

Separator

Dash

Type identifier

I
O

Input page
Output page

Extension separator

Period

10

File extension

S-Step

Business Function

HTML Pages

HTML files contain the layout and field definitions for the individual HTML page
that is sent to the users web browser.
Standard
HTML file names must be matched to their corresponding S-Step file name.
HTML file names must have the following format and components
Format
aabbbb-c.ddd
or
eeeeeeeeeeeeeeeeeeee.fff
Example
BF0050-I.htm
Input HTML page for the Application Control Retrieve (Inquiry) business function
BF0050-O.htm
Output HTML page for the Application Control Retrieve (Inquiry) business
function
ApplicationAnalysis.htm
HTML page used by Application Analysis

Components
Comp.

Pos.

Description

Valid Values/Value Descriptions

aa

1-2

Unique identifier

BF

bbbb

3-6

Business Function Identifier

Business Function Identifiers.

Separator

Dash

Type identifier

I
O

Input page
Output page

Extension separator

Period

ddd

10-12

File extension

htm

HTML page

Business Function

OR
Comp.

Pos.

Description

Valid Values/Value Descriptions

varies

Unique HTML identifier

xxxxx

Textual identifier that describes the purpose of the


HTML page. There is no specific limit to the number
of characters that can be used.

varies

Extension separator

Period

fff

varies

File extension

htm

HTML page

Business Process Flows


Business Process Flow files are used to define the necessary user and
system steps required to complete a Business Process. The
INGENIUM Pathfinder architecture uses the detailed information
contained within a process flow file to control the order of the steps
executed by the user to complete the Business Process.
Standard
Business Process Flow file names must not exceed 15 character in
length (excluding the file extension). This is a limitation of the Security
Edit Table where the Process Flow file names are defined for multilanguage menu support.
Business Process Flow file names must have the following format
and components
Format
aabbbbccccccccc.d
or
eeeeeeeeeeeeeee.f

Example
BF0050Retrieve.f
Application Control Retrieve (Inquiry) Process Flow
VulIndivSearch.f
VUL Application Entry Individual Search Process Flow

Comp.

Pos.

Description

Valid Values/Value Descriptions

eeeeeeee
eeeeeee

1-15

Unique Process Flow


identifier

xxxxx

1 - 15 characters that describe the


purpose of the Business Process
Flow

varies

Extension separator

Period

varies

File extension

Flow file

Co
mp.

P
o
s.

Description

Valid Values/Value Descriptions

aa

12

Unique
identifier

BF

bbb
b

36

Business
Function
Identifier

See Business Function Identifiers.

cccc
cccc
c

81
5

Business
Function Type

xxxxx 1 to 9 characters of text identifying


the primary business function of the flow.
Valid values for maintenance related
process flows include:
Create
Update
Delete
Retrieve (single row retrieve)
List (multiple row retrieve)
Copy (clone)

Business Function

v
ar
ie
s

Extension
separator

Period

v
ar
ie
s

File extension

Flow file

Program & Copybook Naming Convention

Sub-System
APEX Upload

Present Layer
Administration
Fund

B
C
F

New Business
Seg Fund

N
S

Utilities

Numbers, Letters, File


(mnemonic)

Module Type

Depends on Module Type


(d is not needed when b is D,F or M)

Copybook

Business Function

Valuation

Batch Parameter

TPI

Batch Job

Batch Procedure

Program

Module Naming Conventions

Online Program Types


OM Main Program
LA Immed Ann Specific
LC Common Ins Worker
LF Function Driver
LH Health Ins Specific
LI Insurance Driver
LR RRIF(CA) Specific
LS Sub-Function Driver
LT Trade Life Specific
LU Utility Program
LV Univ Life Specific
LW ISWL Specific
LY Country Specific

Other Called Programs


DU Utility Program

Batch Program Types

BM Main Program
BU Utility Program
RA Immed Ann Specific
RC Common Ins Worker
RF Function Driver
RH Health Ins Specific
RI Insurance Driver
RQ Seq or VSAM I/O
RR RRIF(CA) Specific
RS Sub-Function Driver
RT Trade Life Specific
RU Utility Program
RV Univ Life Specific
RW ISWL Specific
RY Country Specific

Module Naming Conventions


I/O Program Types
IA
IB
IC
IF
IG
IK
IN
IT
IU
IV

Insert Record
Browse Record
Initialize Table Layout
MIN/MAX Select
Delete Recs (Range)
I/O Buffering
Select Record
Browse All Rows
Update/Delete Record
Browse Prev. Record

Each individual Business Function (also known as BFID) supported by INGENIUM must
be assigned a unique identifier.
The identifier is a four digit numeric value.
Each identifier is defined within the INGENIUM Business Function (BFCN) database
table.
Business Functions that are related should be grouped together.
Business Functions that are related to the maintenance of a specific table should be
grouped together and should contain the following value as the last digit of the identifier.

0 - Retrieve (Inquiry)

1 - Create
2 - Update
3 - Delete
4 - List

Where the code is stored in TSO?


MSTCMN.ATLS.BATCH.VENDSRC (Batch source)
MSTCMN.ATLS.MIXED.VENSRC (I/O module source)
MSTCMN.ATLS.ONLINE.VENDSRC (Online source)
MSTCMN.ATLS.ONLINE.SOURCE (Online source)
MSTCMN.ATLS.VENDCOPY.MOD (copybooks)
MSTCMN.ATLS.USERPROC (Procs)
MSTCMN.ATLS.PRODJOBS (Jcls)

EXERCISE
Use the Ingenium coding standards for the following:
Whats this?
1. CCFRPOL
2. CCPP9410
3. BF0050-P.p
4. CSLU1680
Write the Five business process naming conventions to perform the
functions on a Policy table.

THANK YOU

You might also like