rspec/rules/S3891/cobol/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

51 lines
1.2 KiB
Plaintext

== Why is this an issue?
The number of ``++RECORDS++`` or ``++CHARACTERS++`` specified in a ``++BLOCK CONTAINS++`` clause is used to determine block size. Specify ``++10 RECORDS++``, and the block will be exactly 10x the length of the record. But that may not be the right size, depending on the environment. Instead, it is considered a best practice to specify ``++0 RECORDS++``, so the block size will be calculated automatically.
=== Noncompliant code example
[source,cobol]
----
FD OUTFILE1
BLOCK CONTAINS 32760 RECORDS >* Noncompliant
RECORDING MODE V.
FD OUTFILE2
BLOCK CONTAINS 1024 CHARACTERS. >* Noncompliant
----
=== Compliant solution
[source,cobol]
----
FD OUTFILE1
BLOCK CONTAINS 0 RECORDS
RECORDING MODE V.
FD OUTFILE2
BLOCK CONTAINS 0 RECORDS.
----
=== Exceptions
``++0 CHARACTERS++`` is compliant.
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Specify "0 RECORDS" to allow the blocksize to be calculated automatically.
=== Highlighting
``++n RECORDS++``
endif::env-github,rspecator-view[]