Substring from Field

LANSA Technical

Substring from Field

Mandatory.

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

Rules

Allowable values are:

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

Warnings

  • If *RECORD has been specified for this field, the utmost care should be taken in the substring of the file record. There will be no validation checks to ensure data type/length compatibility. Virtual fields 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 field definition errors could cause unpredictable results.

Tips & Techniques

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

  • The field 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 field containing '123.45' is substringed into position 1 of a signed (6,2) field (which is initially set to *ZERO), the value will be set to 1234.50.

Also See

Start Position

Ý 3.3.3 Substring