After upgrading to Stat 5.7.1 the DMS object file lost the Carriage Returns when copy/move through SFTP so that the dms script don't work.
The issue is still undefined and under investigation of Development. For some reasons the file dms copied/moved through SFTP strips the CR.
WORKAROUND:
Define the .dms file objects as 'IMAGE' instead of 'ASCII'.