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:
github-actions[bot] 2024-05-08 14:48:15 +02:00 committed by GitHub
parent 6179dde9d5
commit e46041cdcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 63 additions and 0 deletions

View 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
View 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]

View File

@ -0,0 +1,2 @@
{
}