Please enable JavaScript to view this site.

The INVALID command is used for data cleansing purposes. This command examines source field/columns where invalid data can and frequently does exist (i.e. a character value in a numeric field), especially in IMS, VSAM and Flat File data. The command can specify individual source field/columns and/or ALL source field/columns of either numeric or character datatypes.  The latter option is particularly useful for IMS and VSAM source data where numeric columns, particularly those that are packed decimal often contain invalid data.

Syntax

INVALID <source_field> | <source_datastore>.ALLNUM | ALLCHAR SETNULL | SETSPACE | SETZERO | SETFZERO | SET 'constant' | SETEXP | KEEP)

 

Keyword and Parameter Descriptions

<source_field> | <source_datastore>.<datatype>  Name of a specific source field/column, generally qualified by its description alias, that may contain invalid data for the data type as defined in the corresponding source data structure.  
 
Alternatively, a source datastore and data type ( can be specified which will result in all source fields/columns of all records read for that source datastore to be evaluated for invalid data for the data type as defined in the corresponding source data structure.

SETNULL  Sets the value of the source data field/column to null.

SETSPACE  Sets the value of the source data field/column to spaces.

SETZERO  Sets the value of the source data field/column to a zero (0).

SETFZERO  Sets the value of the source data field/column to a zero point zero (0.0) for floating point data (source description fields containing decimal places) and zero (0) for integers.

SET  'constant'  Sets the value of the source data field/column to a the value of the constant.

SETEXP  Specifies that an exception should cause the Apply Engine to terminate. While the effect on processing is the same as would happen without the INVALID command being specified, it indicates that it has been previously determined that the condition cannot be resolved simply by changing the data to a predetermined the value.

KEEP  Specifies that the value of the source data field/column will NOT be changed even if it is subject to a subsequent qualifying INVALID command.

EXCEPTION <value> [EXCEPTION <value>] ...

Example1:

Examine the content of source-field1 in source_description using the INVALID command. If an invalid value is found in this field set the value to zero (0) before any action involving the source record takes place including  any source to target mapping.

INVALID source_description.source-field1 SETZERO;

 

Example 2:

Initialize all COBOL source fields in CDCIN defined as zoned numeric or packed decimal to zero.

INVALID CDCIN.ALLNUM SETZERO;

 

Note, some targets including SQL Server, require DECIMAL/NUMBER columns with > zero scale to be initialized with 0.0.

 

Example 3:

Override other qualifying INVALID commands to maintain the content of a specific field in a captured IMS Segment that would otherwise be subject to the SET<value> initialization from Example 2. Note, the use of full qualification of the source field name.

INVALID CDCIN.<segment_alias>.source-field KEEP;