Hi,
It is normal that you cannot use a SQL function on a flat file.
You can split your flat file into 2 files, once for each length. Assuming that the column to mask is a character column. If it is an numeric value than you can use a where clause value < maxvalue.
Or you can load the flat file into a table and use the LEN function.
BR,
Peter