Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Notes on input via SYSDTA

&pagelevel(5)&pagelevel

For compatibility reasons, input of a source program via the system file SYSDTA can be enabled in the C language modes and in the Cfront C++ language mode of the compiler. The following option must be specified for this purpose:

SOURCE=*SYSDTA

Input via SYSDTA is not possible in the modes C++ V3, C++ 2017 and C++ 2020.

In interactive mode, SYSDTA is assigned to the terminal by default. Although source programs could basically be entered from the terminal, it would not be very practical, since the source would not be available later.

This means that if *SYSDTA is specified with the SOURCE option, SYSDTA must be assigned to a cataloged file or a PLAM library element. The appropriate command for this purpose is as follows:

/ASSIGN-SYSDTA TO-FILE = {dateiname | *LIB-ELEM(LIB=bibliothek,ELEM=element)}The assignment can be made by the following methods:

  1. Assigning SYSDTA before calling the compiler

    Example

    /ASSIGN-SYSDTA TO-FILE=source
    /START-CPLUS-COMPILER

    The assigned source must include all required MODIFY statements and the COMPILE statement before the actual source code:

    //MODIFY-SOURCE-PROP LANG=*C
    //MODIFY-...
    //COMPILE SOURCE=*SYSDTA,...
    #include ...
    main() {
    ...
    }
    
  2. Assigning SYSDTA after calling the compiler

    Example

    /START-CPLUS-COMPILER

    //MODIFY-SOURCE-PROP LANG=*C

    //MODIFY-...

    //EXECUTE-SYSTEM-CMD (ASSIGN-SYSDTA TO-FILE=source)

    The required MODIFY statements are specified before reassigning SYSDTA and are hence not needed in the assigned source. Following the EXECUTE statement, no further SDF statements may be specified. The assigned source must include at least the COMPILE statement before the actual source code:

    //COMPILE SOURCE=*SYSDTA,...
    #include ...
    main() {
    ...
    }
    

When the end of the source file is reached, the compiler run terminates. SYSDTA cannot be reassigned again within a compiler run.

Note that the input source continues to be SYSDTA even though the source program has been assigned with the ASSIGN-SYSDTA command. Consequently, the source program name “CSTD” is used as the basis for generating default names (see also the output parameter *SOURCE-LOCATION or ELEMENT=*STD-ELEMENT). Furthermore, when a library element is assigned with the ASSIGN-SYSDTA command instead of the SOURCE option, the *SOURCE-LIBRARY specification has no effect.