Substring from Column

Mandatory.

Specify the source column (real or virtual) in the physical table or the record contents of the physical table (*RECORD) that is to be used for the substring operation.

Rules

Allowable values are:

  • A real or virtual column defined in the table definition.
  • *RECORD indicates that the full record content of the table is to be used.
  • You cannot perform a substring from a decimal column to an alpha column.

Warnings

  • If *RECORD has been specified for this column, the utmost care should be taken in the substring of the table record. There will be no validation checks to ensure data type/length compatibility. Virtual columns formed as a result of a substring operation specifying *RECORD are totally your responsibility.
  • PLEASE be careful when performing this option when using *RECORD as column definition errors could cause unpredictable results.

Tips & Techniques

Following are special notes for substring virtuals when used with alpha column into a numeric column:

  • The column should only contain the digits 0-9. Any other character, including a sign character ('+' or '-'), will give unpredictable results.
  • Substring is performed from left to right, therefore if a column containing '123.45' is substringed into position 1 of a signed (6,2) column (which is initially set to *ZERO), the value will be set to 1234.50.


Also See

Start Position

  • No labels