diff --git a/rules/S6946/jcl/metadata.json b/rules/S6946/jcl/metadata.json new file mode 100644 index 00000000000..ed8e9a6d8e4 --- /dev/null +++ b/rules/S6946/jcl/metadata.json @@ -0,0 +1,23 @@ +{ + "title": "Incompatible parameters should not be used", + "type": "BUG", + "status": "ready", + "remediation": { + "func": "Constant\/Issue", + "constantCost": "5min" + }, + "tags": [ + ], + "defaultSeverity": "Critical", + "ruleSpecification": "RSPEC-6946", + "sqKey": "S6946", + "scope": "All", + "defaultQualityProfiles": ["Sonar way"], + "quickfix": "unknown", + "code": { + "impacts": { + "RELIABILITY": "HIGH" + }, + "attribute": "CONVENTIONAL" + } +} diff --git a/rules/S6946/jcl/rule.adoc b/rules/S6946/jcl/rule.adoc new file mode 100644 index 00000000000..3d133060882 --- /dev/null +++ b/rules/S6946/jcl/rule.adoc @@ -0,0 +1,54 @@ +== Why is this an issue? + +In JCL, certain parameters are incompatible with each other. For example, in the `DD` statement, the `DYNAM` parameter should not have any parameters coded after it, or the `DLM` parameter is only meaningful with `DD *` and `DD DATA`. Using incompatible parameters can lead to unexpected behavior or JCL errors. It can also make the code harder to understand and maintain. + +== How to fix it + +Remove one of the incompatible parameters from the JCL statement. Refer to the issue message and the JCL language reference to find the incompatible parameter pairs. + +=== Code examples + +In the following example, the `DLM` parameter is only compatible with `DD *` and `DD DATA`. +In addition, `SYSOUT` and `VOLUME` are incompatible parameters and coding both of them on the same `DD` statement will lead to a JCL error. + +==== Noncompliant code example + +[source,jcl,diff-id=1,diff-type=noncompliant] +---- +//STEP1 EXEC PGM=DOTHING +//SYSIN DD DSN=A.B.C,DLM='AA' <-- Noncompliant +//SYSPRINT SYSOUT=*,VOLUME=SER=339006 <-- Noncompliant +---- + +==== Compliant solution + +[source,jcl,diff-id=1,diff-type=compliant] +---- +//STEP1 EXEC PGM=DOTHING +//SYSIN DD DSN=A.B.C +//SYSPRINT SYSOUT=* +---- + +== Resources + +=== Documentation + +* https://www.ibm.com/docs/en/zos/3.1.0?topic=mvs-zos-jcl-reference[z/OS MVS JCL Reference] + +ifdef::env-github,rspecator-view[] + +''' +== Implementation Specification +(visible only on this page) + +=== Message + +* Primary: Remove this '%s' parameter; it is incompatible with an earlier parameter '%s'. +* Primary for DLM: Remove this 'DLM' parameter; it is only compatible with in-stream data sets. +* Secondary: Incompatible parameter. + +=== Highlighting + +The primary location should be the parameter, with a secondary location on the earlier parameter. + +endif::env-github,rspecator-view[] diff --git a/rules/S6946/metadata.json b/rules/S6946/metadata.json new file mode 100644 index 00000000000..2c63c085104 --- /dev/null +++ b/rules/S6946/metadata.json @@ -0,0 +1,2 @@ +{ +}