Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-1593

The return codes of CICS commands with "RESP" or "NOHANDLE" conditions should be tested

    XMLWordPrintable

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Default Severity:
      Critical
    • Impact:
      High
    • Likelihood:
      Low
    • Legacy Key:
      CICS.StatementWithUntestedReturnCodeCheck
    • Covered Languages:
      Cobol
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      1h

      Description

      After calling CICS commands with the RESP or NOHANDLE options, the return code should be tested.

      Noncompliant Code Example

        EXEC CICS DELETEQ TS        *> Noncompliant; WS-STATUS should have been tested before the MOVE
          QNAME(WS-TS5FTARF-NAME)
          RESP(WS-STATUS)        
        END-EXEC.                   
        MOVE WS-EIBTASKN (4:4) TO WS-TS5FTAR1-NAME-TSKID.
      

      Compliant Solution

        EXEC CICS DELETEQ TS
          QNAME(WS-TS5FTARF-NAME)
          RESP(WS-STATUS)        
        END-EXEC.                   
        IF WS-STATUS ...
      
        MOVE WS-EIBTASKN (4:4) TO WS-TS5FTAR1-NAME-TSKID.
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              freddy.mallet Freddy Mallet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: