Create rule S6977: RLSE should be used in SPACE directive (#3922)
--------- Co-authored-by: antonioaversa <antonioaversa@users.noreply.github.com> Co-authored-by: Antonio Aversa <antonio.aversa@sonarsource.com> Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
This commit is contained in:
parent
6179dde9d5
commit
e46041cdcd
23
rules/S6977/jcl/metadata.json
Normal file
23
rules/S6977/jcl/metadata.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"title": "RLSE should be used in SPACE directive",
|
||||
"type": "CODE_SMELL",
|
||||
"status": "ready",
|
||||
"remediation": {
|
||||
"func": "Constant\/Issue",
|
||||
"constantCost": "5min"
|
||||
},
|
||||
"tags": [
|
||||
],
|
||||
"defaultSeverity": "Major",
|
||||
"ruleSpecification": "RSPEC-6977",
|
||||
"sqKey": "S6977",
|
||||
"scope": "All",
|
||||
"defaultQualityProfiles": [],
|
||||
"quickfix": "unknown",
|
||||
"code": {
|
||||
"impacts": {
|
||||
"RELIABILITY": "MEDIUM"
|
||||
},
|
||||
"attribute": "EFFICIENT"
|
||||
}
|
||||
}
|
38
rules/S6977/jcl/rule.adoc
Normal file
38
rules/S6977/jcl/rule.adoc
Normal file
@ -0,0 +1,38 @@
|
||||
== Why is this an issue?
|
||||
|
||||
When the `RLSE` parameter is specified in a `SPACE` directive, the system releases unused space that has been allocated for the data set.
|
||||
|
||||
Omitting this parameter can cause a waste of unneeded space reserved for the data set.
|
||||
|
||||
== How to fix it
|
||||
|
||||
=== Code examples
|
||||
|
||||
==== Noncompliant code example
|
||||
|
||||
[source,jcl,diff-id=1,diff-type=noncompliant]
|
||||
----
|
||||
//STEP1 EXEC PGM=IEFBR14
|
||||
//OUT1 DD DSN=A.B.C,
|
||||
// UNIT=3390,VOL=SER=Z19SPL,
|
||||
// DISP=(NEW,CATLG),
|
||||
// SPACE=(CYL,(1,1)) <-- Noncompliant
|
||||
----
|
||||
|
||||
==== Compliant solution
|
||||
|
||||
[source,jcl,diff-id=1,diff-type=compliant]
|
||||
----
|
||||
//STEP1 EXEC PGM=IEFBR14
|
||||
//OUT1 DD DSN=A.B.C,
|
||||
// UNIT=3390,VOL=SER=Z19SPL,
|
||||
// DISP=(NEW,CATLG),
|
||||
// SPACE=(CYL,(1,1),RLSE)
|
||||
----
|
||||
|
||||
== Resources
|
||||
=== Documentation
|
||||
|
||||
* IBM Documentation - https://www.ibm.com/docs/en/zos/3.1.0?topic=statement-space-parameter[SPACE parameter]
|
||||
* IBM Documentation - https://www.ibm.com/docs/en/zos/3.1.0?topic=definition-system-assignment-space[System assignment of space]
|
||||
|
2
rules/S6977/metadata.json
Normal file
2
rules/S6977/metadata.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user