CRITICAL
Rule Definition
Use BLOCK CONTAINS 0 allows the operating system to optimize the block size and ensure that the maximum number of records will be processed for a single file input/output operation. Small block sizes increase runtime and larger block sizes reduce runtime.
Remediation
Add a BLOCK CONTAINS 0 clause or set the value to 0 in the file descriptor (FD) to let the system using the most suitable value.
Violation Code Sample
* Example 1 - Block size will not be optimized by system
DATA DIVISION.
FILE SECTION.
FD FICIN LABEL RECORDS ARE STANDARD.
01 FICIN-REC PIC X(80).
* Example 2 - Block size will not be optimized by system
DATA DIVISION.
FILE SECTION.
FD FICIN LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 10 RECORDS.
01 FICIN-REC PIC X(80).
* Example 3 - Block sizes will be optimized by system
DATA DIVISION.
FILE SECTION.
FD FICIN-1 LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS.
01 FICIN-1-REC PIC X(80).
FD FICIN-2 LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 CHARACTERS.
01 FICIN-2-REC PIC X(80).
FD FICIN-3 LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0.
01 FICIN-3-REC PIC X(80).
Fixed Code Sample
* Example 1
DATA DIVISION.
FILE SECTION.
FD FICIN LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0.
01 FICIN-REC PIC X(80).
* Example 2
DATA DIVISION.
FILE SECTION.
FD FICIN LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS.
01 FICIN-REC PIC X(80).
Reference
IBM Enterprise Cobol for z/OS - Programming Guide
Related Technologies
Cobol
Technical Criterion
Efficiency - SQL and Data Handling Performance
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.