The third (length) parameter in SUBSTR($x,22,12) is optional:
quote:
Length

Optional numeric value representing the length of the substring. If omitted or if there are fewer than Length characters in the text (including the character at start), all characters from the start position to the end of the string are returned.

_________________________
There are two types of vessels, submarines and targets.