For details see the following sections:
Note that the listing file must not contain any additional text before the start of the compiler output. Otherwise BS2IDE can't identify the compile language and therefore can't interpret the listing.
The listing file must contain the source - error listing. The library listing needed
by the Incremental Project Builder
is always generated.
For debugging specify TEST-SUPPORT = *AID(STMT-REFERENCE = *LINE-NUMBER, PREPARE-FOR-JUMPS = *YES )
.
The option STMT-REFERENCE = *COLUMN-1-TO-6
is not supported.
Therefore, at least the following compile options (or corresponding COMOPT) must
be set (see COBOL2000 V1.5 COBOL Compiler User Guide):
LISTING = *PARAMETERS (SOURCE = *YES (INSERT-ERROR-MSG = *YES), LAYOUT = *STD) TEST-SUPPORT = *AID(STMT-REFERENCE = *LINE-NUMBER, PREPARE-FOR-JUMPS = *YES )Furthermore, the primary source must not contain
>>LISTING OFF
directives to guaranty that all source lines are found in the listing.
However, >>LISTING OFF
within COPY elements would be allowed.
The names of listing files generated by COBOL2000 are derived from the program name rather than
the source file name. Therefore listings should be output to *SYSLST
which is
assigned to a file with a name derived from the source file name. A simple compile command
compiling sources in simple files and writing listings to simple files could look like this:
/ASSIGN-SYSLST &{list-full-file-name} /START-COBOL2000-COMPILER SOURCE = &{src-full-file-name}, - / LISTING = *PARAMETERS (SOURCE = *YES (INSERT-ERROR-MSG = *YES), OUTPUT = *SYSLST) , - / TEST-SUPPORT = *AID(STMT-REFERENCE = *LINE-NUMBER, PREPARE-FOR-JUMPS = *YES ) /ASSIGN-SYSLST *PRIMARYNote: in most cases such a simple command sequence will not suffice and you should prefer to provide a command procedure on the BS2000 system and replace the command sequence by
/CALL-PROCEDURE ...
.
Note: Error messages might not be merged correctly into the source listing if the expanded source contains more than 65535 lines. In this case a note will be inserted at line 1.
The listing parser tries to synchronize with the original source at the next line where no replacement is effective. In some cases sync may fail, so that problem markers cannot be set and you must inspect the listing file for compiler messages.
The compile rule should call an SDF procedure like this:
/BEGIN-PARAMETER-DECLARATION / DECLARE-PARAMETER LIB (TYPE = STRING) / DECLARE-PARAMETER SRC (TYPE = STRING) /END-PARAMETER-DECLARATION /SET-FILE-LINK SESAMOML, $TSOS.SYSLNK.SESAM-SQL.070 /ASSIGN-SYSDTA TO-FILE = *SYSCMD /START-ESQLCOB - / SOURCE = *LIB-ELEM(&LIB, &SRC..ESQL), - / SOURCE-PROPERTIES = (CATALOG = INFO, SCHEMA = INFO), - / INCLUDE-LIBRARY = $TSOS.SYSLIB.ESQL-COBOL.030.INCL-V2, - / PRECOMPILER-ACTION = (SQL-ENTRY-NAME = SQLENTR), - / HOST-PROGRAM = *LIB-ELEM(&LIB, &SRC..CBL), - / MODULE-LIBRARY = *LIB-ELEM(&LIB, SQLPROG.OUT) /SET-JOB-STEP /ASSIGN-SYSLST *LIB-ELEM(&LIB, &SRC..LST, P) /START-COBOL2000-COMPILER - SOURCE = *LIB-ELEM(&LIB, &SRC..CBL), - / LISTING = *PARAMETERS (SOURCE = *YES (INSERT-ERROR-MSG = *YES), OUTPUT = *SYSLST) /ASSIGN-SYSLST *PRIMARY /EXIT-PROCEDUREThe preprocessor input is expected in
*LIB-ELEM(&LIB, &SRC..ESQL, S)
.
The intermediate COBOL source will be generated in the same library as
*LIB-ELEM(&LIB, &SRC..CBL, S)
. The compiler listing will be generated
as *LIB-ELEM(&LIB, &SRC..LST, P)
.
/SET-JOB-STEP
catches possible bad exit codes of the preprocessor.
Corresponding messages will be inserted as comments in the COBOL source generated
by the preprocessor and are interpreted by the COBOL listing parser to create
problem markers.
CROSS-REFERENCE = *YES(VAR = *NO, FUNC = *NO, LABELS = *NO)
.
Then only the file table will be generated.
Therefore, at least the following listing properties must be set
(see C/C++ Compiler User Guide,
MODIFY-LISTING-PROPERTIES
statement):
SOURCE = *YES, LISTING-PRAGMAS = *SELECT (LIST = *NO), CROSS-REFERENCE = *YES(VAR = *NO, FUNC = *NO, LABELS = *NO)A simple compile command and statement sequence compiling sources in libraries and writing listings and object modules to the same library could look like this:
/START-CPLUS-COMPILER //MODIFY-LISTING-PROPERTIES SOURCE = *YES, LISTING-PRAGMAS = *IGNORED, OUTPUT = *SOURCE-LOCATION, CROSS-REFERENCE = *YES //COMPILE *LIBRARY-ELEMENT(LIBRARY = &{src-lib-name}, ELEMENT = &{src-elem-name}), MODULE-OUTPUT = *SOURCE-LOCATION) //STEP //ENDThe statement
//STEP
is necessary to recover the statement sequence from syntax errors recognized
by the C/C++ compiler, see C/C++ Compiler User Guide.
Note, in most cases such a simple command and statement sequence will not suffice and you should prefer
to provide a command procedure on the BS2000 system and replace the command and statement sequence
by /CALL-PROCEDURE ...
.
FORMAT = F-ASSEMB-COMPATIBLE
are not supported.
The Incremental Project Builder
also needs the list of macros and copy elements included during this compilation. This list is only
contained in the cross reference listing. However, if you don't need the cross reference information for symbols
you may specify CROSS-REFERENCE = PARAMETERS(MACRO = YES, COPY = YES)
. Then only the information
about macros and copy elements will be generated.
Therefore, at least the following compile options (or corresponding COMOPT) must be set
(see ASSEMBH User Guide V1.2):
LISTING = PARAMETERS(PRINT-STATEMENTS = IGNORED, SOURCE-FORMAT = STD, CROSS-REFERENCE = PARAMETERS(MACRO = YES, COPY = YES))
SOURCE-PRINT
must either be WITH-OBJECT-CODE
(the default) or SOURCE-ONLY
.MACRO-ORIGIN-INFO = SEPARATE
(the default).
Further, the default layout must be used: LAYOUT = PARAMETERS(FORMAT = STD)
.
If source files contain multiple programs, ASSEMBH would generate mutliple listing files, one for each program. The following simple compile command avoids this:
/ASSIGN-SYSLST &{list-full-file-name} /START-PROG $ASSEMBH //COMPILE SOURCE = &{src-full-file-name}, LISTING = PARAMETERS(OUTPUT = *SYSLST, PRINT-STATEMENTS = IGNORED, CROSS-REFERENCE = ALL) //END /ASSIGN-SYSLST *PRIMARYNote, in most cases such a simple command sequence will not suffice and you should prefer to provide a command procedure on the BS2000 system and replace the command sequence by
/CALL-PROCEDURE ...
.
Therefore, at least the following listing properties must be set
(see SPL4 Compiler User Guide, *COMOPT LIST
statement):
*COMOPT LIST=(SOURCE,XREF=(INCL))
A simple compile command and statement sequence compiling sources in libraries and writing listings and object modules to the same library could look like this:
/ASS-SYSLST *L-E(&{list-lib-name},&{source}.LST,P) /START-EXEC FROM-FILE=(LIB=$TSOS.SYSLNK.SPL4.&{spl-version},ELEM=COMPILER) /SE-DA '*COMOPT SOURCE=&{src-lib-name}(&{src-elem-name})' /SE-DA '*COMOPT LIBRARY=*(&{spl-include-library})' /SE-DA '*COMOPT NOLIST=(OPTIONS,MAP,ATR,DIAG,SUMMARY)' /SE-DA '*COMOPT LIST=(SOURCE,XREF=(INCL))' /SE-DA '*END' /ASS-SYSLST *PRIMARYThe placeholders &{spl-version} and &{spl-include-library} must be defined or replaced by specific values.
Note, in most cases such a simple command and statement sequence will not suffice and you should prefer
to provide a command procedure on the BS2000 system and replace the command and statement sequence
by /CALL-PROCEDURE ...
.