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

43 lines
1.2 KiB
Plaintext

== Why is this an issue?
After calling CICS commands with the ``++RESP++`` or ``++NOHANDLE++`` options, the return code should be tested.
=== Noncompliant code example
[source,cobol]
----
EXEC CICS DELETEQ TS *> Noncompliant; WS-STATUS should have been tested before the MOVE
QNAME(WS-TS5FTARF-NAME)
RESP(WS-STATUS)
END-EXEC.
MOVE WS-EIBTASKN (4:4) TO WS-TS5FTAR1-NAME-TSKID.
----
=== Compliant solution
[source,cobol]
----
EXEC CICS DELETEQ TS
QNAME(WS-TS5FTARF-NAME)
RESP(WS-STATUS)
END-EXEC.
IF WS-STATUS ...
MOVE WS-EIBTASKN (4:4) TO WS-TS5FTAR1-NAME-TSKID.
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
=== is related to: S1587
=== on 1 Feb 2016, 11:29:42 Pierre-Yves Nicolas wrote:
\[~freddy.mallet] The title and description of this rule mention ``++NOHANDLE++`` but the current implementation does nothing related to ``++NOHANDLE++`` and it seems that there's nothing to test when ``++NOHANDLE++`` is used according to the https://www-01.ibm.com/support/knowledgecenter/SSGMCP_5.1.0/com.ibm.cics.ts.applicationprogramming.doc/topics/dfhp4_nohandleintro.html[documentation].
endif::env-github,rspecator-view[]