Create rule S6942: Procedures should not contain in-stream data (#3741)
* Create rule S6942 * Add rule description --------- Co-authored-by: sallaigy <sallaigy@users.noreply.github.com> Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
This commit is contained in:
parent
47a517fc47
commit
cf7dd4781a
23
rules/S6942/jcl/metadata.json
Normal file
23
rules/S6942/jcl/metadata.json
Normal file
@ -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"
|
||||
}
|
||||
}
|
40
rules/S6942/jcl/rule.adoc
Normal file
40
rules/S6942/jcl/rule.adoc
Normal file
@ -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
|
||||
/*
|
||||
----
|
2
rules/S6942/metadata.json
Normal file
2
rules/S6942/metadata.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user