COMPILING UNDER TSO - IBM Mainframe

To compile your program under TSO, use the commands, ALLOCATE and CALL. Under TSO, you can use TSO commands or command lists (CLIST) or 1SPF to compile your program.

Allocating Compilation Data Sets—ALLOCATE Command

First, allocate the data sets you need for compilation, as shown in the following listing:

Allocating Compilation Data Sets—ALLOCATE Command

Allocating Compilation Data Sets—ALLOCATE Command

You can enter these ALLOCATE commands in any order. However, you must enter all of them before you start to compile. (Good programming practice dictates that you free your files before you allocate them.)

  • For any compilation, allocate the work data sets (SYSUTn, and the SYSIN and SYSPRINT data
  • Allocate the SYSLIN data set to produce an object module (you have specified the OBJECT compiler option).
  • Allocate the SYSTERM data set to get compiler messages at. your terminal (you have specified the TERMINAL option).
  • Allocate the SYSLIB data set if you have specified the LIB option and if you have used COPY or REPLACE statements in your VS COBOL II program.
  • Allocate SYSUT5 if you have specified the LIB option in your program.

Requesting Compilation-CALL Command

After you have allocated the data sets, issue a CALL command requesting compilation. To request compilation using the default compiler options, enter:

Allocating Compilation Data Sets—ALLOCATE Command

Allocating Compilation Data Sets—ALLOCATE CommandYou can also put the commands for allocating data sets in a CLIST.

Batch Compiling

A sequence of separate COBOL programs may be compiled with a single invocation of the compiler. The object programs produced from this compilation may be link-edited into either one load module or separate load modules. The NAME compiler option may be used for this.

Each program in the sequence must be terminated by an END PROGRAM header, except the last program in the batch (for which the END PROGRAM header is optional). CBL/PROCESS statements may optionally precede each program in the sequence.

If the END PROGRAM header is omitted from a program (other than the last program in a sequence of separate programs), the next program in the sequence will be nested within the preceding program. In this case, an intervening PROCESS statement will cause the generation of error diagnostics. An intervening CBL statement will also cause the generation of error diagnostics unless the CBL statement is coded entirely within the sequence number area (columns 1 through 6). In this case, no diagnostic message will be issued for the CBL statement because it is considered a label for the source statement line.

Options for each program in the sequence may be specified in the installation default macro, on the invocation of the compiler, and on CBL/PROCESS statements preceding a program. The following rules hold for options in a batch compile:

  • The option settings used for each program in the sequence are based on the following hierarchy.
  • Installation defaults, fixed at your site
  • The values of the BUFS1ZE, LIB, OUTDD, and SIZE compiler options that were in effect for the first program in the batch
  • The CBL/PROCESS statements, if any, for the current program
  • Options specified on the compiler invocation (for example, JCL PARM or TSO Call)
  • Non-fixed installation defaults. .

If the current program does not contain CBl/PROCESS statements, then the settings of options that were in effect for the previous program are used. If a CBL/PROCESS statement is specified in the current program, the CBL/PROCESS statements are resolved together with the options in effect prior to the first program.

  • If the BUF, LIB, OUTDD, or SIZE options are required by any program in the sequence, they must be in effect for the first program of the batch sequence. (All programs in the batch will be treated as a Jingle input file during BASIS, COPY, or REPLACE processing.)
  • If the LIB option is specified for the batch the NUMBER and SEQUENCE options cannot be changed during the batch compilation.

Required Compiler Data Sets

Basic compilation requires the following data sets:

  • SYSIN - To define the source input data set
  • SYSPR1NT - To define the printed output data set
  • SYSUT1, SYSUT2, WSUT3, SYSUT4, SYSUT6, SYSUT7 - To define work data sets. An optional work data set, SYSUT5, must be specified if you are using the LIB compiler option which is required if you have COPY, REPLACE, or BASIS statements in your program).

If you are requesting specific compilation features, specify the following data sets (through DD statements):

  • SYSTERM - If you are using the TERMINAL compiler option, to get the compiler progress and diagnostic messages
  • SYSPUNCH - If you are using the DECK compiler option, to request an object module to a device or data set
  • SYSUN - If you are using the OBJECT compiler option, to request that an object module be produced (define the object module data set)
  • SYSUDUMP or SYSABEND - If you are using the DUMP compiler option, to request that a dump be written on one of these data sets
  • SYSLIB - If your source program uses the COPY or BASIS statement, to define the library input data set.

Logical Record Length and Block Size for Compiler Data Sets

For compiler data sets other than the work data sets, block size can be specified by using the BLKSIZE sub-parameter of the DCB parameter. The value specified must be permissible for the device on which the data set resides. LRECL equals the logical record length, and BLKSIZE equals LRECL multiplied by n, where it is equal to the blocking factor. The logical record lengths for the compiler data sets have the following default values and should not be changed:

  • SYSIN - 80 bytes
  • SYSLIN - 80 bytes
  • SYSPUNCH - 80 bytes
  • SYSLIB or other copy libs - 80 byte's
  • SYSPRINT - 80 bytes
  • SYSTERM - 80 bytes

Defining the Source Code Data Set-SYSIN

Define the data set that contains your source code with the SYSIN DD statement.

Defining the Source Code Data Set-SYSIN

You can place your source code or BASIS statement directly in the input stream. If you do so, use this SYSIN DD statement:

Defining the Source Code Data Set-SYSIN

Defining the Source Code Data Set-SYSINWhen you use the DD convention, the source code or BASIS statement must follow the statement. If another job step follows the compilation, the EXEC statement for that step follows the /* statement or the last source statement.

Defining the Output Data Set-SYSPRINT

This data set is used by the compiler to produce a listing. Output may be directed to a printer, a direct access device, or a magnetic-tape device. The listing will include the results of the default or specified options of the PARM parameter (that is, diagnostic messages, the object code listing). For example:

Defining the Output Data Set-SYSPRINT

Directing Compiler Messages to Your Terminal—SYSTERM

Define the SYSTERM data set to send compiler messages to your terminal.

Directing Compiler Messages to Your Terminal—SYSTERM

SYSTERM can be defined as a SYSOUT data set, as a data set on disk or to another print class, and so on.

Specifying Libraries-SYSLIB

Add the SYSLIB DD statements if your program contains COPY or BASIS statements. These DD statements define the libraries (partitioned data sets) that contain the data requested by COPY statements (in the source code) or by a BASIS statement in the input stream.

Specifying Libraries-SYSLIB

You don't need the SYSLIB DD statement if the NOLIB option is in effect. Concatenate multiple DD statements if you have multiple copy or basis libraries. Libraries are kept on direct-access storage devices. For example:

Specifying Libraries-SYSLIB

Creating Object Code-SYSLIN or SYSPUNCH

When using the OBJECT compiler option, you can store the object code on disk or tape. The compiler uses the file you define in the SYSLIN or SYSPUNCH DD statement to store the object code. You don't need the SYSLIN DD statement if the NOOBJECT option is in effect.

Creating Object Code-SYSLIN or SYSPUNCH

Through the DJSP parameter of the SYSLIN DD statement, you can specify whether the object code data set is to be:

  • Passed to the linkage editor
  • Cataloged
  • Kept
  • Added to an existing cataloged library

In the example above, the data is created and passed to another job step, the linkage editor job step. Your installation may use the DECK option and the SYSPUNCH DD statement. An example of the SYSPUNCH DD statement follows.

Creating Object Code-SYSLIN or SYSPUNCH

'B' is the standard output class for punch data sets. You don't need the SYSPUNCH DD statement if the NODECK option is in effect.

Cataloged Procedures Make Compiling Simpler

A cataloged procedure is a set of job control statements placed in a partitioned data set called the procedure library (SYS1.PROCLIB). Using cataloged procedures can save you some JCL coding. To use a cataloged procedure, specify it in an EXEC statement in your job control procedure.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics