-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create rule S6939: DD DATA should be delimited (#3734)
* Create rule S6939 * Add rule description * Update rules/S6939/jcl/rule.adoc Co-authored-by: Rudy Regazzoni <[email protected]> --------- Co-authored-by: sallaigy <[email protected]> Co-authored-by: Gyula Sallai <[email protected]> Co-authored-by: Rudy Regazzoni <[email protected]>
- Loading branch information
1 parent
a2241c3
commit a1a88a2
Showing
3 changed files
with
65 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": "DD DATA statements should be delimited", | ||
"type": "CODE_SMELL", | ||
"status": "ready", | ||
"remediation": { | ||
"func": "Constant\/Issue", | ||
"constantCost": "1min" | ||
}, | ||
"tags": [ | ||
], | ||
"defaultSeverity": "Major", | ||
"ruleSpecification": "RSPEC-6939", | ||
"sqKey": "S6939", | ||
"scope": "All", | ||
"defaultQualityProfiles": ["Sonar way"], | ||
"quickfix": "unknown", | ||
"code": { | ||
"impacts": { | ||
"MAINTAINABILITY": "MEDIUM" | ||
}, | ||
"attribute": "CLEAR" | ||
} | ||
} |
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,40 @@ | ||
== Why is this an issue? | ||
|
||
The `DD DATA` statement continues reading in-stream data until it reaches the end delimiter (`/*` or the delimiter specified by the `DLM` parameter) or until it hits the end-of-file. This can lead to other JCL statements being mistakenly included in the data stream. | ||
|
||
== How to fix it | ||
|
||
Always code a delimiter for `DD DATA` statements, either by using the default delimiter `/*` or coding a custom delimiter using the `DLM` parameter. | ||
|
||
=== Code examples | ||
|
||
==== Noncompliant code example | ||
|
||
[source,jcl,diff-id=1,diff-type=noncompliant] | ||
---- | ||
//STEP1 EXEC PGM=DOTHING | ||
//SYSIN DD DATA | ||
//ALPHA JOB ,MSGLEVEL=(1,1) | ||
//NOPE EXEC PGM=IEFBR14 | ||
//STEP2 EXEC PGM=IEFBR14 | ||
//* End of file | ||
---- | ||
|
||
==== Compliant solution | ||
|
||
[source,jcl,diff-id=1,diff-type=compliant] | ||
---- | ||
//STEP1 EXEC PGM=DOTHING | ||
//SYSIN DD DATA,DLM='><' | ||
//ALPHA JOB ,MSGLEVEL=(1,1) | ||
//NOPE EXEC PGM=IEFBR14 | ||
>< | ||
//STEP2 EXEC PGM=IEFBR14 | ||
//* End of file | ||
---- | ||
|
||
== Resources | ||
|
||
=== Documentation | ||
|
||
* https://www.ibm.com/docs/en/zos/3.1.0?topic=statement-data-parameter[IBM z/OS MVS JCL Reference - DD DATA parameter] |
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 @@ | ||
{ | ||
} |