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

60 lines
2.0 KiB
Plaintext

== Why is this an issue?
Host variables are used for passing data back and forth from the database to a COBOL program via SQL. In order to keep that transmission clear and free of errors, the format of each host variable should match its corresponding database column type.
This rule raises an issue when column and corresponding host variable don't match in terms of numeric vs character data, and when the host variable is smaller than the column width.
=== Noncompliant code example
[source,cobol]
----
TODO
----
=== Compliant solution
[source,cobol]
----
TODO
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Correct the format of "xxx" to match "[relevant bit of column config]".
=== Highlighting
* primary: host var
* secondary: column name
** message: "X" is "[relevant bit of config]".
'''
== Comments And Links
(visible only on this page)
=== on 6 Oct 2016, 12:25:19 Pierre-Yves Nicolas wrote:
This RSPEC will need to define precisely which DB2 types are "compatible" with which COBOL types.
=== on 13 Oct 2016, 13:43:30 Ann Campbell wrote:
\[~pierre-yves.nicolas] take a look at the http://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/apsg/src/tpc/db2z_equivalentcoboldatatypes.html[IBM spec] & see if you want to replicate that into the RSpec. Maybe we add that reference to the See section?
=== on 14 Oct 2016, 17:49:12 Pierre-Yves Nicolas wrote:
\[~ann.campbell.2] The IBM spec definitely helps and shows that it would take a long time to cover all possible cases. We should probably focus on the most common cases that we want to catch. The most basic rule is "don't mix numeric with character". We also have to check the length of variables: the "receiving" side should be long enough to store the "sent" value. I'm not sure how we should describe all of that.
=== on 17 Oct 2016, 16:06:22 Ann Campbell wrote:
\[~pierre-yves.nicolas] I've expanded the description slightly
endif::env-github,rspecator-view[]