Same difference in erroneous behaviour whether the copybook is for the working-storage or the procedure division ...
java.lang.RuntimeException: syntax error in line 12:7 no viable alternative at input '\n .'
at io.proleap.cobol.preprocessor.sub.document.impl.ThrowingErrorListener.syntaxError(ThrowingErrorListener.java:20)
at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:282)
at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:121)
at io.proleap.cobol.Cobol85PreprocessorParser.copyStatement(Cobol85PreprocessorParser.java:582)
at io.proleap.cobol.Cobol85PreprocessorParser.startRule(Cobol85PreprocessorParser.java:186)
at io.proleap.cobol.preprocessor.sub.document.impl.CobolDocumentParserImpl.processWithParser(CobolDocumentParserImpl.java:85)
at io.proleap.cobol.preprocessor.sub.document.impl.CobolDocumentParserImpl.processLines(CobolDocumentParserImpl.java:61)
at io.proleap.cobol.preprocessor.impl.CobolPreprocessorImpl.parseDocument(CobolPreprocessorImpl.java:58)
at io.proleap.cobol.preprocessor.impl.CobolPreprocessorImpl.process(CobolPreprocessorImpl.java:101)
at io.proleap.cobol.preprocessor.impl.CobolPreprocessorImpl.process(CobolPreprocessorImpl.java:86)
at io.proleap.cobol.preprocessor.impl.CobolPreprocessorImpl.process(CobolPreprocessorImpl.java:65)
The required DOT for a copy-statement must not be on a single line ;) else a parsing error is thrown.
You may write
Copy mycopy . (DOT)
but notAA1.cbl.txt mycopy.CPY.txt
Same difference in erroneous behaviour whether the copybook is for the working-storage or the procedure division ...