By default, the compiler expects source data from the system file SYSDTA. SYSDTA can be assigned to a cataloged file or library element before the compiler is called. The command for this is:
/ASSIGN-SYSDTA [TO =] {filename | *LIB-ELEM(LIB=library,ELEM=element)}
Detailed information on the ASSIGN-SYSDTA command can be found in the “BS2000/OSD-BC Commands” manual [3].
Example 2-2
Reading a compilation unit from a cataloged file
/ASSIGN-SYSDTA SOURCE.MULTABLE ————————————————————————————————————(1) Call to compiler ——————————————————————————————————————————————————(2) /ASSIGN-SYSDTA *PRIMARY ——————————————————————————————————————————(3)
(1) | The cataloged file SOURCE.MULTABLE, which contains the compilation unit to be compiled, is assigned to the SYSDTA system file. |
(2) | The compiler is loaded and started. It processes the data that is received from SYSDTA. This applies only when the compiler is not called via the SDF interface and when source = ... is not specified here. |
(3) | The SYSDTA system file is reset to its primary assignment for subsequent tasks. |
Example 2-3
Reading a compilation unit from a library
/ASSIGN-SYSDTA *LIBRARY-ELEMENT(LIB=PLAM.LIB,ELEM=EXAMP3) —————————(1) Call to compiler ——————————————————————————————————————————————————(2) /ASSIGN-SYSDTA *PRIMARY ——————————————————————————————————————————(3)
(1) | The system file SYSDTA is assigned to the element EXAMP3 in the PLAM library PLAM.LIB. |
(2) | The compiler is invoked. It accesses the assigned library element via SYSDTA. See the example above. |
(3) | SYSDTA is reset to its primary assignment. |
Other methods for the input of source data are related to controlling the compiler with COMPOPT statements and are described in the chapter "Controlling the compiler with COMOPT statements".