rspec/rules/S3625/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

44 lines
1.1 KiB
Plaintext

== Why is this an issue?
If a SQL ``++TABLE++`` is declared but not used in the program, it can be considered dead code and should therefore be removed. This will improve maintainability because developers will not wonder what the variable is used for.
=== Noncompliant code example
[source,cobol]
----
EXEC SQL
DECLARE DSN8B10.DEPT TABLE -- Noncompliant
( ... )
END-EXEC.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove this table "XXX" declaration; it is never used.
=== Highlighting
``++DECLARE ... TABLE++``
'''
== Comments And Links
(visible only on this page)
=== on 6 Oct 2016, 11:42:58 Pierre-Yves Nicolas wrote:
IBM reference for DECLARE...TABLE: \http://www.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/sqlref/src/tpc/db2z_sql_declaretable.html
=== on 29 Nov 2016, 11:42:13 Pierre-Yves Nicolas wrote:
We should not raise an issue when a ``++DECLARE...TABLE++`` is inside a copybook: a COBOL program, which could be in another project, could use this copybook and this ``++DECLARE...TABLE++`` declaration.
endif::env-github,rspecator-view[]