Professional Documents
Culture Documents
LEVEL I Credit Cards Business Processes V1.0
LEVEL I Credit Cards Business Processes V1.0
Introduction
First Data – Coding standards to be used with all Cobol programs
We shall cover the Cobol Coding standards for following topics
• Identification Division
• Environment Division
• Data Division
• Working Storage Section
• Procedure Division
• Table Handling
Configuration section.
File Section.
Level numbers:
Level Numbers. • Begin with 01 in column 8 and increment by 2,
01 (Record name) going up as high as necessary. For example, use
level numbers 01, 03, 05, and so forth. Always start
in a column that is an increment of 4. Indent each
increment by 4.
• Coded as two digits, followed by two spaces,
followed by a data name.
Begins in column 8, with the record name beginning in
column 12. The record name must be a group item
(does not have a picture clause).
Do not use.
Do not use.
‘66’ Levels Defines values for all non monetary data elements where
‘77’ Levels needed
‘88’ Levels Example: Always code “If condition name…” Do not
code “If data element (not equal…”
Detail lines. All detail print lines should be redefines of the original 01 Level item. Report lines
are not defined under the FD for the print file in the data division.
Heading lines. Should not exceed the maximum number of heading lines printed on any one
report.
Working Storage Section
COBOL Statement Existing Standard
Justified (Right) Begin in column 52.
(Just)
Occurs clause. Begin in column 52. Table must be contained in a group item.
Use the abbreviation PIC and begin in column 36. Two spaces
Picture clause. after PIC for all non-signed fields, and always a 2-digit (or
more) designation - (02) not (2).
Print lines. Defined in working storage with 132 bytes each.
Redefines:
•Begins in the same column as the PIC clause
Redefines clause. •If using indexing, the indexed by clause follows the occurs
clause
•Must equal the size of the area being redefined.
Value (literal). Begin in column 52. Do not use the word ‘IS’.
Procedure Division
COBOL Statement Existing Standard
Call /Using/ Use only dynamic Calls. Do not use static Calls.
Begin Using in column 40.
Conditional expressions.
Can be used.
Replacing
Display statement
Display (ID-1/LIT-1) Use only with the common ABEND routine and
mnemonic name /Upon to allow for multiple tape mounts.
(function-name)/
Do not use in any program. Use an asterisk ‘*’ in column 7 for any
Note comments.
Procedure Division
COBOL Statement Existing Standard
Read
/Read next/ Always use for sequential VSAM file processing.
/Invalid-key/ Do not use. Instead, use file status check.
/At End/ Do not use. Instead, use file status check.
Read Filename Into Exceptions to the Read Into are for Variable 01 Record
Identifier Layouts where the read must be into the FD to
determine the record layout needed.
End Read.
Perform
Basic Perform-- Code all performs using one of the following
Inline Perform-- formats:
– Perform (Imperative statements) End-
Perform Procedure-Name-1 Perform.
Thru Procedure-Name-2 – Perform (procedure name 1) through
(procedure name 2)… where procedure
Times Option-- name 2 is always a paragraph containing
Perform Procedure-Name-1 only an Exit statement.
Thru Procedure-Name-2
Begin THRU under the PERFORM:
(ID-1/LIT-1) Times. PERFORM xxxxxxxx
Conditional Perform-- THRU xxxxxxxx.
Perform Procedure-Name-1
Thru Procedure-Name-2 Do not include a GOTO in any performed
Until Condition-1. paragraph(s) that branches outside of the
Varying Option-- paragraph(s).
End Perform.
Procedure Division
COBOL Statement Existing Standard
Do not use. Use an asterisk (*) in column 7 instead.
Skip No blank lines should be coded for spacing purposes.
Sort Can be Used
Start
/Invalid-key/
Start File-Name Can be used for VSAM files.
(Key Is /Equal to/
Should not be used. Instead, use file status check.
/Greater than/
/Not Less than/ Avoid using Equal To.
Data name)
End Start.
Procedure Division
COBOL Statement Existing Standard
Stop Run There should be only one Stop Run statement in each
batch program.
Never use a Stop Run statement in an online program.
Use Go Back.
Write
Physical sequential files
Write record-name (from
ID)
(/Before/)
Advancing For print files:
(ID-2/Integer) Use Before Advancing instead of After Advancing
(Mnemonic name/page)
VSAM Sequential Files-- Indicate new page by ‘Page’ instead of mnemonic
Write record-name Name
(From identifier).
VSAM indexed and Do not use ‘EOP’ or ‘End-of-Page’
relative files--
Write record-name
(From identifier)
(File Status Check).
End Write.
Table Handling
COBOL Statement Existing Standard
Can be used.
Initialize Do not initialize tables using overlapping operands
Occurs
Fixed Length Tables--
Occurs Integer-2 Times.
Variable Length Tables-- Use
Occurs Integer-1 to
Integer-2 Times
Depending On Data-
Name-1.
Table Handling
COBOL Statement Existing Standard
Search
Search All Can be used.
Search All Identifier-1 (At an
Imperative-statement) end-search
Rule #2
Rule #4
• All custom modification copybooks should be located either
at the end of working storage (for working storage
copybooks), or at the end of the program (for procedure
division copybooks).
Rules for Coding
Rule #5
• There will be one custom modification copybook per
modification per program, except where a copybook is
needed in-stream or is reusable in multiple programs.
Rule #6
• The program containing the procedure division or working
storage copybook should also contain a comment line prior
to the copy statement.
Rules for Coding
Rule #7
New procedure division or working storage copybooks should
contain a comment box at the beginning of the copybook. To
make these comment boxes easily identifiable, the comment
should specify the originating programs.
Sample0....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
******************************************************************ZH110002
* *ZH110002
* *ZH110002
Rules for Coding
Rule #8
These documentation lines must be the same within all the programs,
0....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
++++++ - - -
Rule #11
When modifying an existing program, attempt to maintain the
same coding style and standards. When adding new programs
or replacing existing programs, adhere to the new coding
standards.
Rules for Coding
Rule #12
Use comments to document and explain
complex code or techniques.
Rule #13
When adding new custom maps, add
redefinition copybooks.
• For example : ARZM01 & ARZM01R
Rules for Coding
Rule #14
When adding new fields to the files RL/IR Copybooks, ALWAYS add the new
fields immediately below the filler.
DO not use any USER-FILLER. They are reserved for the customer's use.
RULE #15
RULE #16