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
SELECT * used in custom SQL

Yes

Yes

-

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

Job Naming

Yes

Yes

Yes

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

Unique Sort

Yes

Yes

-

Identifies unique sorts

Transformer Uses 'Rnd()' Function

Yes

-

-

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

Link Sort

Yes

-

-

Identifies link sorts

Password Param Type not Encrypted

Yes

Yes

-

Identify unencrypted Job parameters used for storing passwords

Hardcoded File Paths

Yes

Yes

-

Ensures that all File Stages must use variables for determining paths

Using DB2 Sequence to Generate Surrogate Key

Yes

Yes

-

Identifies where a Db2 Sequence is used to provide a surrogate key value.

Job Using Custom Function

Yes

Yes

-

Here

Audit Annotation

Yes

Yes

Yes

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

Job Using ODBC Connector

Yes

-

-

Identifies job using an ODBC connector

Default Naming

Yes

Yes

Yes

Default Stage Names for Parallel Jobs, Server Jobs, and Job Sequences

File Row Limit

Yes

Yes

-

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

Column Name Contains Unsupported Characters

-

Yes

-

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

Job Activity References Deleted Child Parameter

-

-

Yes

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

Custom Stages

Yes

Yes

-

This rule detects the use of Custom stages in Parallel Jobs

Oracle Connector not using Partition Read

Yes

-

-

Identify Oracle Stages not configured to use partitioned reads

CCMigrateTool Stages

Yes

Yes

-

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

Join Partition vs Join Key

Yes

-

-

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

Lookup Failure

Yes

-

-

Identifies Lookup Stages with Lookup set to Fail

Database Connector does not Auto-Generate SQL

Yes

Yes

-

Ensures a Database Connector uses Auto Generated SQL

Adjacent Transformers

Yes

Yes

-

Identified job designs with adjacent Transformer stages.

DataStage SaaS Unsupported Stages

Yes

-

-

Detects the stages in Parallel Jobs that are not currently support by DataStage Saas

Log Column Values

Yes

Yes

-

Identify Stages configured to Log column values on first row error

Debug Row Limit

Yes

-

-

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

Aggregator Not Preceded by ‘Check’ Sort

Yes

-

-

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

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.

DataStage Flow Designer Stages

Yes

Yes

-

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

Sequence Reset If Required

-

-

Yes

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

Redundant Sort

Yes

Yes

-

Identifies redundant sorts within a job

DB2 with No Non Recovery Load

Yes

Yes

-

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

Job Sequence Is Restartable

-

-

Yes

Identifies Job Sequences that are not restartable

Job Parameter Not Used in a Job

Yes

-

-

Identifies Job parameters which are not used within the job.

System Time Dependency

Yes

-

-

Identifies the use of system time in the job

DBConnector Supported Variants

Yes

Yes

-

Ensures that all Database Connectors and Stages must use valid variants

Job Control Routines are present

Yes

Yes

-

Identifies Jobs with Job Control Routines defined

Job Activity with Hardcoded Parameter Values

-

-

Yes

Sequence Job with Hardcoded Parameter Values

Database Row Limit

Yes

Yes

Yes

Identifies Connectors Stages with a configured Database Row Limit

Stage Naming

Yes

Yes

Yes

Stage Naming Standards for Parallel and Server Jobs and Job Sequences

Job Does Not Contain DM Unit Test Parameter

Yes

Yes

Yes

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

Sort Post Join Stage

Yes

Yes

-

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

Job Sequence Handles Activities That Fail

-

-

Yes

Verifies that a job sequence automatically handles failed activities

Job Using Transformer Surrogate Key

Yes

-

-

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

Job Parameter Not in a Parameter Set

Yes

Yes

Yes

Identifies Job parameters which are not members of a parameter sets

Deprecated Stages

Yes

Yes

-

Identify deprecated stages and suggests the recommended alternative

Data Sets not using 'Same' partitioning method

Yes

-

-

Identifies Data Sets not using the 'Same' partitioning method

CP4D Unsupported Stages

Yes

Yes

-

Identifies stages that are not yet supported by IBM Cloud Pak for Data

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 Parameter Missing Default Value

Yes

Yes

Yes

Identify Job parameters within a default value

Sequential File With Reject Mode Not Set To Fail

Yes

-

-

Identifies Sequential Files with a Reject Mode not set to fail

Duplicate Stage Names

Yes

Yes

-

Detect duplicate Stage names in a job

Database tables references are fully qualified

Yes

Yes

-

Identifies where database table references are fully-qualified

Jobs With Before and After Routine

Yes

Yes

-

Here

Stages Not Supporting Lineage

Yes

Yes

-

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

Row Splitter with No Delimiter

Yes

-

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

Transformer Uses 'Abort after rows'

Yes

-

-

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

One Dataflow

Yes

Yes

-

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

Prohibited Stages

Yes

Yes

-

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

Sequential File Read Using Same Partitioning

Yes

-

-

Avoid Reading from Sequential Files Using the Same Partitioning Method

Hardcoded DB Credentials

Yes

Yes

-

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

Job Parameter Naming

Yes

Yes

Yes

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

Schema Files

Yes

-

-

Detect the use of Schema Files

Too Many Stages

Yes

Yes

-

Identifies whether a Job has too many Stages

File Reference Missing Required Parameter

Yes

Yes

-

Ensures that all File Stages must use variables for determining paths

Transformer With Unreferenced Stage Variable

Yes

Yes

-

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

Asset using Java Integration Stage

Yes

-

-

Identifies the use of the Java Integration Stage which is not supported by DataStage SaaS.

Range Lookup

Yes

-

-

Checks that range lookups are correctly configured

SQL in DB Connectors

Yes

Yes

-

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

Deprecated Transformer Functions

Yes

Yes

-

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

Encrypted DB Passwords

Yes

Yes

-

Ensures that all Connectors and Stages must use encrypted Passwords