As noted by @user207421 ERASE
is not a statement, it is a clause for the DISPLAY
statement, and it even is standardized - but (standard-wise) it needs a specification what you want to erase:
ERASE [END] [OF] LINE
[END] [OF] SCREEN
EOL
EOS
The syntax you have shown is actually the very non-standard, outdated Microsoft-COBOL DISPLAY
statement with ERASE phrase
.
If you still use open-cobol then the package is heavily outdated, there should be a new gnucobol package available in Ubuntu (otherwise you could build from source). Using GnuCOBOL 2.2 you get a nicer error message:
error: syntax error, unexpected ., expecting LINE or SCREEN
And then you can decide if you want the old ms-cobol variant (that's supported in GnuCOBOL, but only with the pos-specifier) or the standard variant (ERASE EOS
would be the compatible version and is supported by many compilers).