-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create rule S6946: Incompatible parameters should not be used (#3747)
- Loading branch information
1 parent
b4ce142
commit 14fd3e1
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |