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

59 lines
1.7 KiB
Plaintext

== Why is this an issue?
Because statically-called programs must be relinked before they reflect changes in the code, it makes sense to prefer dynamic calls instead. Further, since statically-called programs are included in the caller's load module, those modules could require more main storage than if the calls were dynamic, and the called programs could reside in memory multiple times - one for each caller.
While static calls are faster, their other disadvantages make dynamic calls the preferred method. Thus, this rule raises an issue when the program to ``++CALL++`` is hard-coded, rather than specified in a variable.
=== Noncompliant code example
[source,cobol]
----
CALL 'MYPRGM01' USING PARAM1. *> Noncompliant
----
=== Compliant solution
[source,cobol]
----
77 PRGM-NAME PIC X(8) VALUE 'MYPRGM01'.
[...]
CALL PRGM-NAME USING PARAM1.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Use a variable to specify the program to "CALL".
=== Highlighting
``++CALL 'xxxx'++``
'''
== Comments And Links
(visible only on this page)
=== on 22 Mar 2016, 09:15:31 Pierre-Yves Nicolas wrote:
I think the title should not mention "arguments". The rule is only about the program which is called, not the arguments (defined in the ``++USING++`` clause).
See the http://www.ibm.com/support/knowledgecenter/SS6SG3_5.1.0/com.ibm.entcobol.doc_5.1/PGandLR/ref/rlpscall.html[IBM reference for CALL].
=== on 22 Mar 2016, 13:41:03 Ann Campbell wrote:
How's this [~pierre-yves.nicolas]?
=== on 22 Mar 2016, 13:49:02 Pierre-Yves Nicolas wrote:
Looks good [~ann.campbell.2].
endif::env-github,rspecator-view[]