Skip to content

Commit

Permalink
Create rule S6937: Missing mandatory statement name (#3722)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Mar 5, 2024
1 parent c3b0ab2 commit aff3433
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
23 changes: 23 additions & 0 deletions rules/S6937/jcl/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"title": "Missing mandatory statement name",
"type": "BUG",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "2min"
},
"tags": [
],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-6937",
"sqKey": "S6937",
"scope": "All",
"defaultQualityProfiles": ["Sonar way"],
"quickfix": "unknown",
"code": {
"impacts": {
"RELIABILITY": "HIGH"
},
"attribute": "CONVENTIONAL"
}
}
35 changes: 35 additions & 0 deletions rules/S6937/jcl/rule.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
In-stream procedures should always have a name.

== Why is this an issue?

In JCL, it is expected for a PROC statement inside of a job stream to have a name.

== How to fix it

=== Code examples

==== Noncompliant code example

[source,jcl,diff-id=1,diff-type=noncompliant]
----
//MYJOB JOB DXXX
// PROC
//STEP1 EXEC PGM=MYPGM
// PEND
----

==== Compliant solution

[source,jcl,diff-id=1,diff-type=compliant]
----
//MYJOB JOB DXXX
//TRPOC PROC
//STEP1 EXEC PGM=MYPGM
// PEND
----

== Resources

=== Documentation

* https://www.ibm.com/docs/en/zos/3.1.0?topic=d-name-field-8[IBM reference - PROC statement - Name field]
2 changes: 2 additions & 0 deletions rules/S6937/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}

0 comments on commit aff3433

Please sign in to comment.