Chapter Contents

Previous

Next
Preprocessing, Compiling, and Linking

Preprocessing, Compiling, and Linking under TSO

The following sections describe how to use the translator (LCCCP) interactively under TSO. The translator alone may be invoked by using the LCCCP CLIST. Alternatively, you can choose to run the translator with the compiler, with the compiler and the linkage editor, or with the compiler with COOL and the linkage editor.


Files Used by the Translator

Depending on which options you specify, you will need two or more of the following files to use the translator under OS/390:

Following are descriptions of each of these files and when they are required. Under TSO, you specify the data set by using CLIST options.

SYSIN
is always required; it describes a C source file containing embedded CICS commands. The input data set can have either fixed-length or variable-length records, blocked or unblocked. LCCCP places no restriction on the LRECL of this data set.

The input data set may have sequence numbers. The translator checks the first record in the source file to determine whether the source file has sequence numbers. If the source file has varying length records, the translator inspects columns 1 through 8; otherwise, it inspects the last eight columns. If the translator finds a sequence number in the first record, the corresponding columns of all subsequent records are ignored.

SYSPUNCH
is always required; it describes the output data set that contains the translated C source file. The output data set can have either fixed-length or variable-length records, blocked or unblocked.

LCCCP places no restriction on the LRECL of this data set, but the LRECL should be at least that of the input data set. If the input data set has fixed-length records and the output data set has variable-length records, then the output LRECL should be at least four characters longer. If the OUTSEQ option is used and the input data set does not have sequence numbers, the output LRECL should be at least eight characters longer.

Note:    The compiler will not accept an input file containing records longer than 1024 characters.  [cautionend]

SYSPRINT
is required if the PRINT option is used; it describes the data set to which the listing will be printed. The listing data set should have a logical record length of 121 and a record format of FBA, and should be a sequential data set.

The listing contains a list of the LCCCP options in effect (if the OPTIONS option is used), a source listing (if the SOURCE option is in effect), and a cross-reference listing (if the XREF option is in effect). Diagnostic messages are also written to the listing. If the EXPAND option is used, the translation of each CICS command is shown.

SYSTERM
is optional; it describes a data set that is used for LCCCP diagnostic messages (if the TERM option is used) and for C library warning messages. The DCB requirements are supplied by LCCCP. This file is automatically allocated by default under TSO.


The LCCCP CLIST

When you use TSO to prepare a SAS/C application program to run in the CICS environment, you invoke a CLIST for the translator before continuing with SAS/C CLISTs for compiling and linking. For information on the SAS/C CLISTs for compiling and linking, see the SAS/C Compiler and Library User's Guide.

To begin the preprocessing step under TSO, invoke the LCCCP CLIST. Because the translator is itself a C program, you must ensure that the transient run-time library is allocated to the DDname CTRANS or is installed in the system link list. Your installation will probably cause it to be allocated automatically. Consult your SAS Software Representative for SAS/C software products to determine if this has been done. If not, use the TSO ALLOCATE command to associate the library with the CTRANS DDname as shown in the following:

ALLOC FI(CTRANS) DA('SASC.LINKLIB') SHR

The format of the LCCCP CLIST is

LCCCP in-dsname [OUTPUT(out-dsname)]

[PRINT(print-file)] options

where

in-dsname
is the name of the SYSIN data set. If the data set belongs to another user, the fully qualified name of the data set must be enclosed in three apostrophes. If the data set name is not fully qualified, the LCCCP CLIST adds the user's prefix and a final qualifier of CCP, if necessary.

out-dsname
is the name of the SYSPUNCH data set. If the data set belongs to another user, the fully qualified name of the data set must be specified and enclosed in three apostrophes. If the data set name is not fully qualified, the LCCCP CLIST adds the user's prefix and a final qualifier of C.

If out-dsname is specified and is not fully qualified, the CLIST will use out-dsname with a final qualifier of C.

print-file
is the name of the SYSPRINT data set. This data set must be sequential. If not fully qualified, the CLIST adds the user's prefix and a final qualifier of CCPLIST.

options
are any LCCCP options, as shown in Specifying Translator Options.

The following is an example of this command:

lcccp 'userid.cics.source(example)'
      output(cout(example))

In this example, the C source code is contained in the PDS referenced by 'userid.cics.source(example)' . The output data set SYSPUNCH is referred to by output(cout(example)) . Because no options are specified, the default values will be used in the translation.


Compiling SAS/C Programs for CICS under TSO

When you execute the SAS/C compilation CLIST, LC370, specify as input the same data set as the one you used for output in the preprocessing step. If you are not familiar with the SAS/C Compiler, see the SAS/C Compiler and Library User's Guide for additional information on executing SAS/C CLISTs. In particular, consult the sections on TSO execution styles.

Note:    CICS requires that all programs be compiled so that they are re-entrant. You must specify the compiler options rent or rentext to cause the compiler to generate re-entrant code because the compiler default for re-entrancy is norent .  [cautionend]

For example, to compile the file FTOC.C.A, you issue the following command:

LC370 ftoc (rent)


Linking SAS/C Programs for CICS under TSO

After you have preprocessed and compiled your program, you are ready to execute the SAS/C link-edit CLIST, CLK370. Specify as input the data set that contains the output from the LC370 CLIST. Use the LOAD option to specify the name of your CICS program library, and use the CICS option so that CICS resident routines will be included at link time.

Regardless of the linking method you use, you must always

The CLISTs distributed by SAS Institute have been written to automate this process by using the following linkage-editor control statements in one form or another:

LIBRARY DFHLIB(DFHEAI,DFHEAIO)
ORDER   DFHEAI

The DDname DFHLIB points to the CICS load library that contains the execution interface stub routines.

When to Use COOL

You must use COOL to preprocess your object code if one or more of the following conditions apply:

See Using TSO CLISTs to Link and the SAS/C Compiler and Library User's Guide for more information on COOL.

Linking All-Resident Programs

The default name of the all-resident library is SASC.CICS.ARESOBJ. (Ask your SAS Software Representative for SAS/C software products for the name of the library at your site.) When linking an all-resident program, concatenate the all-resident library in front of any other autocall data sets, and include the object deck created by compiling a source file that includes <resident.h> and the appropriate macro definitions. See SAS/C Compiler and Library User's Guide for more information on linking all-resident programs. The process of linking all-resident programs is automated through the use of keywords and parameters in the cataloged procedures, CLISTs, and EXECs.


Using TSO CLISTs to Link

The CLK370 CLIST invokes the COOL object code translator, followed by the linkage editor. Optionally, you can skip the COOL step by specifying the NOCOOL option. The format is as follows:

CLK370 dsname <keywords>

where dsname is the name of the object data set that is to be the primary input to COOL or the linkage editor. The data set name should be the name of the data set containing the object code, or the COOL/linkage-editor control statements used as input, or both. Follow standard TSO naming conventions; that is, if the data set belongs to another user, the full name of the data set must be specified, and the name must be enclosed in three apostrophes. If the object code is in a member of a partitioned data set, the member name must be specified in parentheses following the data set name in the normal TSO manner. The final qualifier of the input data set name is assumed to be OBJ. If you do not add this qualifier, it is supplied automatically by the CLIST.

Keywords indicate COOL options, linkage-editor options, or the names of other data sets to use during linking. You must specify either the CICS or the CICSVSE keyword when linking CICS applications. See COOL Options for more information.

Note:    The resident library for the SAS/C compiler is divided into a base resident library and the resident library for standard environments. The base resident library, SASC.BASEOBJ, contains system-independent code. The standard CICS resident library, SASC.CICSOBJ, contains system-dependent code. For more details about using the CLK370 CLIST, consult the SAS/C Compiler and Library User's Guide.  [cautionend]

Executing CLK370 without the IBM Linkage Editor

CLK370 accepts a NOCOOL option that causes the linkage editor to be invoked directly without using the COOL utility. CLK370 allows you to specify any linkage-editor options, such as LIST , LET , MAP , XREF , TEST , RENT , OVLY , AMODE , and RMODE . (These options are valid for the linkage editor whether or not COOL is run.) The IBM linkage editor and loader manual discusses these options.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.