Purpose (problem description)

This page handle the issue of missing violation of quality rules for embedded queries

Avoid Programs with too many FROM Clauses (RPG400)
Avoid Programs with too many WHERE Clauses (RPG400)
Avoid Programs With Queries on more than 4 Tables (RPG400)
Avoid Programs with SELECT * statement (RPG400)
Avoid Programs with SELECT * statement (RPG400)
Avoid Programs With Queries using GROUP BY (RPG400)
Avoid Programs with Subqueries (RPG400)
Avoid using NOT IN (RPG400)
Avoid using NOT EXISTS(RPG400)
Avoid Programs with COUNT(*) statement (RPG400)

Observed in CAST AIP
Release
Yes/No
8.3.x(tick)
Observed on RDBMS
RDBMS
Yes/No
CSS(tick)

Step by Step scenario

  1. Run a full snapshot.
  2. Open CED and observe the missing violation.
Action Plan

Perform the below actions

    1. Check if your object is tagged by one type of search in embedded SQL:

      SELECT * 
      FROM   diag_object_metrics 
      WHERE  metric_type in ( 'RPG400Raw SQL Complexity', 'RPG400SQLNumberOfFromClauses', 'RPG400SQLNumberOfWhereClauses','RPG400SQLJoinsOnMoreThan4Tables', 'RPG400Number of high nested level in tests', 'RPG400NumberOfSubqueries','RPG400UseOfCountStar', 'RPG400UseOfSelectAll', 'RPG400UseOfNotIn', 'RPG400UseOfNOTEXISTS','RPG400NumberOfGROUPBY')
      and    object_id IN 
             ( 
                    SELECT cspec_id 
                    FROM   rpg_pgmc 
                    WHERE  pgm_id IN 
                           ( 
                                  SELECT object_id 
                                  FROM   dss_objects 
                                  WHERE  object_full_name = 'object_full_name'))

      where 'object_full_name' is the name of the object that should be violated.

      Query result sample:

      15358534;"RPG400UseOfNotIn";1;-3

      If the above query do not return results, then your object is not tagged by one type of search in embedded SQL. If you are using CAST AIP lower than 8.2.7 then this is a known bug, else contact CAST Technical Support. with the following Relevant input 

    2. As a WA you can perform the following:

      1. Replace the Existing Language pattern file with the following RPG400LanguagePattern.xml, the file is located at %PROGRAMDATA%\CAST\CAST\Extensions\com.castsoftware.rpg.x.x.x\Configuration\Languages
      2. Run a full snapshot.
      3. Open CED and check if the violation is not missing.

If the above steps do not solve your issue contact CAST Technical Support. with the following Relevant input

 

Notes/comments

Ticket # 9338

Related Pages