Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Producing main programs in C

&pagelevel(3)&pagelevel

It is advisable to link the main program with STDLIB=*DYNAMIC (default value) and call EDT with the ILCS flag indicator.ilcs_environment = 1 (default value). The procedure below compiles and links C main programs which are stored as BEISPIEL1.C, BEISPIEL2.C, ... in the library EDT.BEISPIELE.
The generated program, the compiler lists and the diagnostic output are also stored in this library.

/SET-PROCEDURE-OPTIONS INPUT-FORMAT=FREE-RECORD-LENGTH,/
    DATA-ESCAPE-CHAR=STD
/BEGIN-PARAMETER-DECLARATION
/   DECLARE-PARAMETER NAME=NR
/   DECLARE-PARAMETER NAME=LIB,INITIAL-VALUE=C'EDT.BEISPIELE
/END-PARAMETER-DECLARATION
/START-CPLUS-COMPILER
//MODIFY-SOURCE-PROP LANGUAGE=*C
//MODIFY-RUNTIME-PROPERTIES PARAMETER-PROMPTING=*NO
//MODIFY-INCLUDE-LIBRARIES USER-INCLUDE-LIBRARY=//
    $.SYSLIB.EDT.170                   ------------------------------ (1)
//MODIFY-DIAGNOSTIC-PROPERTIES OUTPUT=*LIBRARY-ELEMENT(//
    LIB=&LIB,ELEM=*STD-ELEMENT()),//
    MIN-MSG-WEIGHT=*NOTE
//MODIFY-LISTING-PROPERTIES OUTPUT=*LIBRARY-ELEMENT(//
    LIB=&LIB,ELEM=*STD-ELEMENT()),SOURCE=*YES()
//COMPILE SOURCE=*LIB-ELEM(LIB=&LIB,ELEM=BEISPIELE&NR..C),//
    MODULE-OUTPUT=*LIB-ELEM(LIB=&LIB,ELEM=BEISPIEL&NR)
//MOD-BIND-PROP INCLUDE=(*LIB(LIB=&LIB,ELEM=BEISPIEL&NR),-   ---------- (2)
//    *LIB(LIB=$.SYSLNK.EDT.170,ELEM=IEDTGLE)),//
    RUNTIME-LANG=*C,STDLIB=*DYNAMIC --------------------------------- (3)
//BIND OUTPUT=*LIB(LIB=&LIB,ELEM=BSP&NR.C)  --------------------------- (4)
//END
/EXIT-PROCEDURE

Explanations

(1)It is assumed that SYSLIB.EDT.170 is installed under the default user ID. The C compiler needs this library in order to locate the IEDTGLE interface header files.
(2)The user program is linked to the module IEDTGLE from SYSLNK.EDT.170. IEDTGLE uses IMON to locate the EDT libraries and either loads EDT dynamically or connects to the EDT subsystem.
(3)The adapter for the C runtime system is automatically linked by the compiler if STDLIB=*DYNAMIC is specified.
(4)

The generated program can then be started with /START-EXECUTABLE-PROGRAM (E=BSPxC,L=EDT.BEISPIELE) (x = 1,2,..).

The ILCS flag is only significant if EDT is to load and call user routines (see the following sections).