Compliance Rules Reference
This page summarises the Compliance Rules currently shipping with MettleCI. Each Compliance Rule file has a .grm extension, referring to the Gremlin language in which it is written. The three-letter sub-extension before .grm refers to the type of DataStage asset to which the rule can be applied:
Compliance Rule Extension | Asset Type |
|---|---|
| Parallel job |
| Sequence job |
| Server job |
| Parallel shared container |
| Server shared container |
You can read more about the MettleCI compliance commands here.
The current set of sample Compliance Rules are detailed below:
| Compliance Rule | Parallel Job | Server Job | Job Sequence | Description |
|---|---|---|---|---|
| Adjacent Transformers | Yes | Yes | - | Identified job designs with adjacent Transformer stages. |
| Aggregator Not Preceded by ‘Check’ Sort | Yes | - | - | Identifies Parallel Aggregator Stages not preceded by a ‘Check’ Sort Stage. |
| Audit Annotation | Yes | Yes | Yes | Identifies where sensitive information may potentially be present in DataStage Job and Sequence Annotations |
| CCMigrateTool Stages | Yes | Yes | - | Identifies the use of deprecated stages in Parallel Jobs and suggests an alternative |
| Column Name Contains Unsupported Characters | - | Yes | - | Identifies stage columns with names using characters not supported by the Parallel Engine. |
| CP4D Unsupported Stages | Yes | Yes | - | Identifies stages that are not yet supported by IBM Cloud Pak for Data |
| Custom Stages | Yes | Yes | - | This rule detects the use of Custom stages in Parallel Jobs |
| Data Sets not using 'Same' partitioning method | Yes | - | - | Identifies Data Sets not using the 'Same' partitioning method |
| Database Connector does not Auto-Generate SQL | Yes | Yes | - | Ensures a Database Connector uses Auto Generated SQL |
| Database Row Limit | Yes | Yes | Yes | Identifies Connectors Stages with a configured Database Row Limit |
| Database tables references are fully qualified | Yes | Yes | - | Identifies where database table references are fully-qualified |
| DataStage Flow Designer Stages | Yes | Yes | - | Lists the stages that are not yet supported by IBM Data Flow Designer |
| Date Format in Annotation | Yes | Yes | Yes | Identify whether the a ‘Job Description’ annotation contains instances of particular arbitrary text. This example rule looks for dates. |
| DB2 with No Non Recovery Load | Yes | Yes | - | Identify Db2 Stages using bulk load with Non Recovery Load set to No |
| DBConnector Supported Variants | Yes | Yes | - | Ensures that all Database Connectors and Stages must use valid variants |
| Debug Row Limit | Yes | - | - | Identifies row limits in debug stages (Peek, Sample, Tail) |
| Default Naming | Yes | Yes | Yes | Default Stage Names for Parallel Jobs, Server Jobs, and Job Sequences |
| Deprecated Stages | Yes | Yes | - | Identify deprecated stages and suggests the recommended alternative |
| Deprecated Transformer Functions | Yes | Yes | - | Identifies calls to deprecated functions in the Transformer Stage code generated by DataStage |
| Duplicate File References | Yes | Yes | - | Verifies that a file is only referenced once in a DataStage job (Sequential File, Complex Flat File and DataSet) |
| Duplicate Stage Names | Yes | Yes | - | Detect duplicate Stage names in a job |
| Encrypted DB Passwords | Yes | Yes | - | Ensures that all Connectors and Stages must use encrypted Passwords |
| File Reference Missing Required Parameter | Yes | Yes | - | Ensures that all File Stages must use variables for determining paths |
| File Row Limit | Yes | Yes | - | Identifies row limits in file-based stages (Sequential File, Complex Flat File) |
| Hardcoded DB Credentials | Yes | Yes | - | Ensures that all Database Connectors and Stages must use variables for location and credentials |
| Hardcoded File Paths | Yes | Yes | - | Ensures that all File Stages must use variables for determining paths |
| Job Activity References Deleted Child Parameter | - | - | Yes | Identify Sequence Job activities with references to non-existent parameters. |
| Job Activity with Hardcoded Parameter Values | - | - | Yes | Sequence Job with Hardcoded Parameter Values |
| Job Control Routines are present | Yes | Yes | - | Identifies Jobs with Job Control Routines defined |
| Job Does Not Contain DM Unit Test Parameter | Yes | Yes | Yes | Identifies Jobs or Sequences where the MettleCI Unit Testing parameter is not present |
| Job Naming | Yes | Yes | Yes | Checks the job name against a blocklist of known bad names (e.g. CopyOf*) |
| Job Parameter Missing Default Value | Yes | Yes | Yes | Identify Job parameters within a default value |
| Job Parameter Naming | Yes | Yes | Yes | Identifies where naming standards for Job Parameters and Parameter Sets are breached |
| Job Parameter Not in a Parameter Set | Yes | Yes | Yes | Identifies Job parameters which are not members of a parameter sets |
| Job Parameter Not Used in a Job | Yes | - | - | Identifies Job parameters which are not used within the job. |
| Job Sequence Handles Activities That Fail | - | - | Yes | Verifies that a job sequence automatically handles failed activities |
| Job Sequence Is Restartable | - | - | Yes | Identifies Job Sequences that are not restartable |
| Job Using Transformer Surrogate Key | Yes | - | - | Recommends considering replacing a Transformer Stage using a Surrogate Key with a Surrogate Key Generator stage. |
| Join Partition vs Join Key | Yes | - | - | Identifies Join stages where the join key does not match the partitioning key |
| Link Sort | Yes | - | - | Identifies link sorts |
| Log Column Values | Yes | Yes | - | Identify Stages configured to Log column values on first row error |
| Lookup Failure | Yes | - | - | Identifies Lookup Stages with Lookup set to Fail |
| One Dataflow | Yes | Yes | - | Verifies that there is only one data flow in a DataStage job |
| Oracle Connector not using Partition Read | Yes | - | - | Identify Oracle Stages not configured to use partitioned reads |
| Transformer Uses 'Abort after rows' | Yes | - | - | Detect an 'Abort after rows' greater than 0 setting in a Parallel Transformer. |
| Transformer Uses 'Rnd()' Function | Yes | - | - | Identify the use of a Rnd() function in Parallel Transformers. |
| Password Param Type not Encrypted | Yes | Yes | - | Identify unencrypted Job parameters used for storing passwords |
| Prohibited Stages | Yes | Yes | - | Verifies that a job does not contain one or more prohibited stages |
| Range Lookup | Yes | - | - | Checks that range lookups are correctly configured |
| Redundant Sort | Yes | Yes | - | Identifies redundant sorts within a job |
| Row Splitter with No Delimiter | Yes | - | Identifies Row Splitter Stage with output format delimited but no delimiter specified | |
| Schema Files | Yes | - | - | Detect the use of Schema Files |
| SELECT * used in custom SQL | Yes | Yes | - | Identifies Connector Stages using customer SQL employing a ‘SELECT *’ clause |
| Sequence Reset If Required | - | - | Yes | Identifies where a Job Activity Execution Action is not Reset if required, then run |
| Sequential File Read Using Same Partitioning | Yes | - | - | Avoid Reading from Sequential Files Using the Same Partitioning Method |
| Sequential File With Reject Mode Not Set To Fail | Yes | - | - | Identifies Sequential Files with a Reject Mode not set to fail |
| Sort Post Join Stage | Yes | Yes | - | Identifies potentially redundant sorting (a sort stage or link sort) situated immediately after a Join stage |
| SQL in DB Connectors | Yes | Yes | - | Identify the use of hardcoded SQL in Database Connectors or Enterprise Database Stages. |
| Stage Naming | Yes | Yes | Yes | Stage Naming Standards for Parallel and Server Jobs and Job Sequences |
| Stages Not Supporting Lineage | Yes | Yes | - | This rule detects the use of stages in Parallel Jobs that don't support automatic lineage |
| System Time Dependency | Yes | - | - | Identifies the use of system time in the job |
| Too Many Stages | Yes | Yes | - | Identifies whether a Job has too many Stages |
| Transformer With Unreferenced Stage Variable | Yes | Yes | - | Identifies Transformer Stage with an unreferenced Stage Variable (including Loop Variables) |
| Unique Sort | Yes | Yes | - | Identifies unique sorts |