Created On:  23 February 2011

Problem:

A COBOL developer wanted to obtain a compiler listing fie (.lst) including both the data cross-reference and the source code listing.  The compiler directive XREF was specified in the "cob" compilation command.   When the resulting .lst file was examined, the cross-reference was present, but the source code was not included.

The "cob" compilation command specified a directives file, like so:

cob -C directives=/directory-path/site/cobol.dir -C XREF -uvP helloworld.cbl

The file /directory-path/site/cobol.dir was discovered to include the compiler directive ERRLIST, which was preventing the source code from being included in the .lst file.  Testing at Micro Focus showed that changing ERRLIST to ERRLIST"EMBED" would give the desired behavior, requiring no other changes to the "cob" compilation command.

However, due to policies at the site, users were not authorized to modify the /directory-path/site/cobol.dir file and change ERRLIST to ERRLIST"EMBED".  Also, ERRLIST"EMBED" cannot be specified in a $SET statement in the source code.  What do I do?

Resolution:

One option is to include the ERRLIST"EMBED" directive in the compile command, after the directives file, like so:

cob -C directives=/directory-path/site/cobol.dir -C XREF -C ERRLIST="EMBED" -uvP helloworld.cbl

Another option: create a new directives file (let's call it "coboldirfile") in your home directory and put these directives in it:

XREF
ERRLIST(EMBED)

Then modify the compile command accordingly, for example:

cob -C directives=/directory-path/site/cobol.dir -C directives=/home/coboldirfile -uvP helloworld.cbl

This will provide a .lst file with both the data cross-reference and the source code.  The options from the first directives file will not be affected, except only that the ERRLIST option will be overridden.
Incident #2497729