scale
Specifies the scale of a packed decimal.
Applies to
Imported strings representing packed decimals; exported packed decimals to be written as strings; record, subrec, or tagged if it contains at least one field of this type.
Syntax
record { scale = s }
field_definition { scale = s };
where s is the scale.
Discussion
By default, the import operator uses the scale defined for the InfoSphere® DataStage® decimal field to import the source field. You can change this. On import, the scale property specifies the scale of the source packed decimal.
By default, when the export operator exports a source decimal to a string representation, it uses the precision and scale defined for the source decimal field to determine the length of the destination string. You can override the default by means of the precision and scale properties. When you do, the export operator truncates or pads the source decimal to fit the size of the destination string. If you include the width property, the export operator truncates or pads the source decimal to fit the size specified by width. See width.
Restrictions
The scale property is ignored on export if you also specify text.
The value of scale must be less than the precision and greater than 0. The precision is specified by the precision property. See precision.
Example
The following example is a schema used to import a source field with the same precision and scale as the destination decimal:
record ( a:decimal[6,2]; )
InfoSphere DataStage imports the source field to a decimal representation with a 2-digit scale.
The following schema overrides this default to import a source field with a 4-digit precision and a 1-digit scale:
record ( a:decimal[6,2] {precision = 4, scale = 1}; )