Starting the compiler from an assembler program

You can start the Enterprise COBOL compiler from within an assembler program by using the ATTACH or the LINK macro by dynamic invocation. You must identify the compiler options and the ddnames of the data sets to be used during processing.

For example:

symbol {LINK|ATTACH} EP=IGYCRCTL,PARAM=(optionlist[,ddnamelist]),VL=1
EP
Specifies the symbolic name of the compiler. The control program (from the library directory entry) determines the entry point at which the program should begin running.
PARAM
Specifies, as a sublist, address parameters to be passed from the assembler program to the compiler.

The first fullword in the address parameter list contains the address of the COBOL optionlist. The second fullword contains the address of the ddnamelist.

optionlist
Specifies the address of a variable-length list that contains the COBOL options specified for compilation. This address must be written even if no list is provided.

The optionlist must begin on a halfword boundary. The 2 high-order bytes contain a count of the number of bytes in the remainder of the list. If no options are specified, the count must be zero. The optionlist is freeform, with each field separated from the next by a comma. No blanks or zeros should appear. The compiler recognizes only the first 100 characters.

ddnamelist
Specifies the address of a variable-length list that contains alternative ddnames for the data sets used during compiler processing. If standard ddnames are used, the ddnamelist can be omitted.

The ddnamelist must begin on a halfword boundary. The 2 high-order bytes contain a count of the number of bytes in the remainder of the list. Each name of less than 8 bytes must be left justified and padded with blanks. If an alternate ddname is omitted from the list, the standard name is assumed. If the name is omitted, the 8-byte entry must contain binary zeros. You can omit names from the end by shortening the list.

All SYSUTn data sets specified must be on direct-access storage devices and have physical sequential organization. They must not reside in the z/OS® UNIX file system.

The following table shows the sequence of the 8-byte entries in the ddnamelist.

Alternative ddname 8-byte entry Name for which alternative ddname is substituted
1 SYSLIN
2 Not applicable
3 Not applicable
4 SYSLIB
5 SYSIN
6 SYSPRINT
7 SYSPUNCH
8 SYSUT1
9 SYSUT2
10 SYSUT3
11 SYSUT4
12 SYSTERM
13 SYSUT5
14 SYSUT6
15 SYSUT7
16 SYSADATA
17 SYSJAVA
18 Start of changeSYSDEBUGEnd of change
19 SYSMDECK
20 DBRMLIB
21 SYSOPTF
22 SYSUT8
23 SYSUT9
24 SYSUT10
25 SYSUT11
26 SYSUT12
27 SYSUT13
28 SYSUT14
29 SYSUT15
VL
Specifies that the sign bit is to be set to 1 in the last fullword of the address parameter list.

When the compiler completes processing, it puts a return code in register 15.