-
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 S6942: Procedures should not contain in-stream data (#3741)
* Create rule S6942 * Add rule description --------- Co-authored-by: sallaigy <[email protected]> Co-authored-by: Gyula Sallai <[email protected]>
- Loading branch information
1 parent
47a517f
commit cf7dd47
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": "Avoid the use of in-stream data in procedures", | ||
"type": "CODE_SMELL", | ||
"status": "ready", | ||
"remediation": { | ||
"func": "Constant\/Issue", | ||
"constantCost": "15min" | ||
}, | ||
"tags": [ | ||
], | ||
"defaultSeverity": "Major", | ||
"ruleSpecification": "RSPEC-6942", | ||
"sqKey": "S6942", | ||
"scope": "All", | ||
"defaultQualityProfiles": [], | ||
"quickfix": "unknown", | ||
"code": { | ||
"impacts": { | ||
"MAINTAINABILITY": "LOW" | ||
}, | ||
"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,40 @@ | ||
== Why is this an issue? | ||
|
||
Earlier versions of z/OS and certain installations do not support in-stream data in procedures. | ||
This can lead to inconsistencies within the codebase and compatibility issues. | ||
|
||
== How to fix it | ||
|
||
Remove the uses of `DD *` and `DD DATA` from procedures. | ||
You can add in-stream data to a procedure step by using `DD DUMMY` inside the procedure and overriding that by a `DD *` or `DD DATA` statement in the calling step. | ||
|
||
=== Code examples | ||
|
||
==== Noncompliant code example | ||
|
||
[source,jcl,diff-id=1,diff-type=noncompliant] | ||
---- | ||
//MYPROC PROC | ||
//STEP1 EXEC PGM=DOTHING | ||
//SYSIN DD * | ||
Input data | ||
/* | ||
// PEND | ||
//* Call procedure | ||
//CALLPRC EXEC PROC=MYPROC | ||
---- | ||
|
||
==== Compliant solution | ||
|
||
[source,jcl,diff-id=1,diff-type=compliant] | ||
---- | ||
//MYPROC PROC | ||
//STEP1 EXEC PGM=DOTHING | ||
//SYSIN DD DUMMY | ||
// PEND | ||
//* Call procedure | ||
//CALLPRC EXEC PROC=MYPROC | ||
//STEP1.SYSIN DD * | ||
Input data | ||
/* | ||
---- |
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 @@ | ||
{ | ||
} |