Compiler Specific Notes for Compile Rules

To be able to interpret the listing generated by the compiler and to set problem markers on the source file you must consider the Compiler Notes. Depending of the Compiler you want to start there are options to be set and other notes to pay attention to.

For details see the following sections:

Note that for debugging additional compiler options are required, see Debug Configuration

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.

COBOL compilation

BS2IDE supports remote compilation with the COBOL2000 compiler as well as COBOL85. The requirements for COBOL85 compilation are similar to those of COBOL2000.

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 *PRIMARY
Note: 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.

Restriction of current release:

If in a COBOL program multi-line replacement (i.e. a single line is replaced by multiple lines) is effective, problem markers may be displaced near lines in which multi-line replacement is effective. This can also happen if the replacement makes the line too long so that the compiler splits it into several lines in the listing.

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.

ESQL/COBOL compilation

BS2IDE also supports remote preprocessing with the ESQL-COBOL preprocessor and subsequent compilation with the COBOL2000 compiler. The source file is the input file for the ESQL-COBOL preprocessor, and the listing file is the final listing file generated by the COBOL2000 compiler. The intermediate COBOL source generated by the precompiler is not relevant for BS2IDE.

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-PROCEDURE
The 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.

C/C++ compilation

BS2IDE supports remote compilation with the BS2000 C/C++ compiler release 3.2D and later. The listing file must at least contain the source - error listing recording all source lines. The Incremental Project Builder also needs the table of files included during this compilation. This table is only contained in the cross reference listing. However, if you don't need the cross reference information you may specify 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
//END
The 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 ....

ASSEMBH compilation

BS2IDE only interprets listings in standard format (see ASSEMBH User Guide, Description of Listings). The listing file must at least contain the standard source program listing (SOURCE LISTING) in the standard layout format. Structured listings and 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 information must not be inserted, i.e. 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 *PRIMARY
Note, 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 ....

SPL compilation

BS2IDE supports remote compilation with the BS2000 SPL compiler release 2.9 and later. The listing file must at least contain the source - error listing recording all source lines. The Incremental Project Builder also needs the table of files included during this compilation. This table is only contained in the include cross reference listing which is part of the cross reference information.

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 *PRIMARY
The 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 ....

Other programming languages and compilers

Compile commands and rules can also be specified for other compilers and programming languages. The listing generated by such compilers will not be interpreted by BS2IDE. You must open the listing file with a text editor to view the error messages reported by the compiler.