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)
Release | Yes/No |
---|---|
8.3.x |
RDBMS | Yes/No |
---|---|
CSS |
Step by Step scenario
- Run a full snapshot.
- Open CED and observe the missing violation.
Perform the below actions
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
As a WA you can perform the following:
- 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
- Run a full snapshot.
- 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
Ticket # 9338