v2.0 v1.3
v2.0 v1.3

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

.pjb.grm

Parallel job

.qjb.grm

Sequence job

.sjb.grm

Server job

.psc.grm

Parallel shared container

.ssc.grm

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
Job Using Transformer Surrogate Key

Yes

-

-

Recommends considering replacing a Transformer Stage using a Surrogate Key with a Surrogate Key Generator stage.

Job Parameter Naming

Yes

Yes

Yes

Identifies where naming standards for Job Parameters and Parameter Sets are breached

Sort Post Join Stage

Yes

Yes

-

Identifies potentially redundant sorting (a sort stage or link sort) situated immediately after a Join stage

Redundant Sort

Yes

Yes

-

Identifies redundant sorts within a job

Deprecated Transformer Functions

Yes

Yes

-

Identifies calls to deprecated functions in the Transformer Stage code generated by DataStage

Password Param Type not Encrypted

Yes

Yes

-

Identify unencrypted Job parameters used for storing passwords

File Row Limit

Yes

Yes

-

Identifies row limits in file-based stages (Sequential File, Complex Flat File)

System Time Dependency

Yes

-

-

Identifies the use of system time in the job

Lookup Failure

Yes

-

-

Identifies Lookup Stages with Lookup set to Fail

Unique Sort

Yes

Yes

-

Identifies unique sorts

Oracle Connector not using Partition Read

Yes

-

-

Identify Oracle Stages not configured to use partitioned reads

Duplicate Stage Names

Yes

Yes

-

Detect duplicate Stage names in a job

CCMigrateTool Stages

Yes

Yes

-

Identifies the use of deprecated stages in Parallel Jobs and suggests an alternative

SELECT * used in custom SQL

Yes

Yes

-

Identifies Connector Stages using customer SQL employing a ‘SELECT *’ clause

Database Row Limit

Yes

Yes

Yes

Identifies Connectors Stages with a configured Database Row Limit

Transformer Uses 'Abort after rows'

Yes

-

-

Detect an 'Abort after rows' greater than 0 setting in a Parallel Transformer.

Row Splitter with No Delimiter

Yes

-

Identifies Row Splitter Stage with output format delimited but no delimiter specified

Job Sequence Is Restartable

-

-

Yes

Identifies Job Sequences that are not restartable

DataStage Flow Designer Stages

Yes

Yes

-

Lists the stages that are not yet supported by IBM Data Flow Designer

Stages Not Supporting Lineage

Yes

Yes

-

This rule detects the use of stages in Parallel Jobs that don't support automatic lineage

Log Column Values

Yes

Yes

-

Identify Stages configured to Log column values on first row error

Hardcoded DB Credentials

Yes

Yes

-

Ensures that all Database Connectors and Stages must use variables for location and credentials

Sequential File Read Using Same Partitioning

Yes

-

-

Avoid Reading from Sequential Files Using the Same Partitioning Method

Job Sequence Handles Activities That Fail

-

-

Yes

Verifies that a job sequence automatically handles failed activities

Sequence Reset If Required

-

-

Yes

Identifies where a Job Activity Execution Action is not Reset if required, then run

Audit Annotation

Yes

Yes

Yes

Identifies where sensitive information may potentially be present in DataStage Job and Sequence Annotations

Range Lookup

Yes

-

-

Checks that range lookups are correctly configured

Column Name Contains Unsupported Characters

-

Yes

-

Identifies stage columns with names using characters not supported by the Parallel Engine.

Stage Naming

Yes

Yes

Yes

Stage Naming Standards for Parallel and Server Jobs and Job Sequences

Transformer With Unreferenced Stage Variable

Yes

Yes

-

Identifies Transformer Stage with an unreferenced Stage Variable (including Loop Variables)

Job Parameter Missing Default Value

Yes

Yes

Yes

Identify Job parameters within a default value

Join Partition vs Join Key

Yes

-

-

Identifies Join stages where the join key does not match the partitioning key

One Dataflow

Yes

Yes

-

Verifies that there is only one data flow in a DataStage job

Schema Files

Yes

-

-

Detect the use of Schema Files

SQL in DB Connectors

Yes

Yes

-

Identify the use of hardcoded SQL in Database Connectors or Enterprise Database Stages.

Job Parameter Not Used in a Job

Yes

-

-

Identifies Job parameters which are not used within the job.

Too Many Stages

Yes

Yes

-

Identifies whether a Job has too many Stages

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

Link Sort

Yes

-

-

Identifies link sorts

Adjacent Transformers

Yes

Yes

-

Identified job designs with adjacent Transformer stages.

Duplicate File References

Yes

Yes

-

Verifies that a file is only referenced once in a DataStage job (Sequential File, Complex Flat File and DataSet)

Job Activity with Hardcoded Parameter Values

-

-

Yes

Sequence Job with Hardcoded Parameter Values

DBConnector Supported Variants

Yes

Yes

-

Ensures that all Database Connectors and Stages must use valid variants

Transformer Uses 'Rnd()' Function

Yes

-

-

Identify the use of a Rnd() function in Parallel Transformers.

Database tables references are fully qualified

Yes

Yes

-

Identifies where database table references are fully-qualified

File Reference Missing Required Parameter

Yes

Yes

-

Ensures that all File Stages must use variables for determining paths

Prohibited Stages

Yes

Yes

-

Verifies that a job does not contain one or more prohibited stages

Job Parameter Not in a Parameter Set

Yes

Yes

Yes

Identifies Job parameters which are not members of a parameter sets

Job Naming

Yes

Yes

Yes

Checks the job name against a blocklist of known bad names (e.g. CopyOf*)

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.

Job Control Routines are present

Yes

Yes

-

Identifies Jobs with Job Control Routines defined

Job Activity References Deleted Child Parameter

-

-

Yes

Identify Sequence Job activities with references to non-existent parameters.

Database Connector does not Auto-Generate SQL

Yes

Yes

-

Ensures a Database Connector uses Auto Generated SQL

Job Does Not Contain DM Unit Test Parameter

Yes

Yes

Yes

Identifies Jobs or Sequences where the MettleCI Unit Testing parameter is not present

Data Sets not using 'Same' partitioning method

Yes

-

-

Identifies Data Sets not 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

Aggregator Not Preceded by ‘Check’ Sort

Yes

-

-

Identifies Parallel Aggregator Stages not preceded by a ‘Check’ Sort Stage.

Debug Row Limit

Yes

-

-

Identifies row limits in debug stages (Peek, Sample, Tail)

Encrypted DB Passwords

Yes

Yes

-

Ensures that all Connectors and Stages must use encrypted Passwords

DB2 with No Non Recovery Load

Yes

Yes

-

Identify Db2 Stages using bulk load with Non Recovery Load set to No

Hardcoded File Paths

Yes

Yes

-

Ensures that all File Stages must use variables for determining paths

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