The selection must only include the code of the actual program or a copybook shown in editable expanded copybook view.
It is not possible to create a new copybook from a selection within a copybook shown in the editor in read-only expanded view or a selection that spans the code of a copybook shown in expanded view and lines of code of the actual program.
In the editor, the selected code is replaced by a COPY statement that refers the new copybook and shows it in expanded copybook view. The case of the statement is as defined on the Formatting page in Tools > Options > Text Editor > Micro Focus COBOL.
If you chose to save the copybook in a directory other than the default, this also adds that directory to the list of copybook locations on the Copybooks tab in the project’s properties.