Chapter Contents

Previous

Next
Preprocessing, Compiling, and Linking

Preprocessing, Compiling, and Linking under CMS

CICS applications can also be developed under CMS. You can preprocess, compile, and link your application under CMS before shipping the resulting object module to an OS/390 or VSE system for final link-editing with the CICS Execution Interface stub routines. For complete details on compiling C programs under CMS, consult the SAS/C Compiler and Library User's Guide.

Before you run the translator, compiler, or COOL under CMS, verify that the transient library is available on an accessed minidisk, or that it is installed in a segment available to your virtual machine. Your SAS Software Representative for SAS/C software products can tell you if this has been done for you.


The Translator Input File

The input file is a C source file containing one or more EXEC CICS commands. The file may be in any format acceptable to the compiler. Thus, it can contain either variable-length or fixed-length records, with a logical record length less than or equal to 1024 characters.

The input file may have sequence numbers. The translator checks the first record in the source file to determine if the source file has sequence numbers. If the source file has variable-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, it ignores the corresponding columns of all subsequent records.

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


The Translator Output File

The output of the translator is subsequently used as input to the compiler. If the OUTSEQ option is used and the input data set does not have sequence numbers, the LRECL of the output file will be eight characters longer than the input file.


The Listing File

A listing file is created unless the NOPRINT option is used. It will have fixed-length records and a logical record length of 121. The listing contains a list of the LCCCP options in effect (unless the NOOPTIONS option is used), a source listing (unless the NOSOURCE option is used), and a cross-reference listing (unless the NOXREF option is used). Diagnostic messages are also written to the listing. If the EXPAND option is used, the translation of each CICS command is shown following the command in the source listing.


Terminal Output

LCCCP prints all diagnostic messages to the terminal unless the NOTERM option is in effect.


The LCCCP EXEC

The LCCCP EXEC invokes the translator in CMS. The format of the LCCCP EXEC follows:

LCCCP filename (filetype (filemode)) [OUT(out-fileid)] [PR(print-fileid)] ((options( )))

where

filename
is the filename of the input file.

filetype
is the filetype of the input file. If filetype is not specified, CCP is the default.

filemode
is the filemode of the input file. If filemode is not specified, A is the default.

out-fileid
is the fileid of the output file. If this option is not specified, the default fileid is filename C A1. If the OUT( ) option is used, the filetype and filemode of the output file may be omitted. The default filetype is C and the default filemode is A1.

print-fileid
is the fileid of the listing file. If this option is not specified, the default fileid is filename CCPLIST A1. If the PR( ) option is used, the filetype and filemode of the listing file may be omitted. The default filetype is CCPLIST and the default filemode is A1.

options
are any of the LCCCP options described in Specifying Translator Options.


Compiling SAS/C Programs for CICS under CMS

When you invoke the compiler with the LC370 EXEC, specify as input the same filename you used for output in the preprocessing step. If you are not familiar with the SAS/C Compiler, refer to SAS/C Compiler and Library User's Guide for additional information.

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 CMS

Regardless of the linking method you use, you must always

The CLISTs and cataloged procedures 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

See Using CMS EXECs 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 CICSARES TXTLIB. (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 the 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 CMS EXECs to Link

The COOL EXEC invokes the COOL object code translator. The format is as follows:

COOL [filename1[filename2 . . . ]] [(options[)]]

where filename1, filename2, and so on are the names of the files that are the primary input to COOL. Each file should have a filetype of TEXT and contain either object code or COOL/linkage-editor control statements. If no filenames are specified, COOL prompts for the name of a primary input file. At the prompt, enter a filename. COOL continues to prompt until a null line is entered. See COOL Options for a list of options.

Several different techniques can be used to run COOL on applications for CICS on CMS. Each technique is just a different way of specifying which text libraries COOL should use for autocall resolution.

The simplest technique is to specify the CICS option to COOL. The CICS option directs COOL to use the LC370CIC TXTLIB and the LC370BAS TXTLIB as autocall libraries. An example invocation would be:

COOL ftoc (CICS)

A second technique is to use the CMS GLOBAL TXTLIB command to explicitly specify which TXTLIBs are to be used by COOL, and not to specify any COOL options. For example

GLOBAL TXTLIB LC370CIC LC370BAS
COOL ftoc

If you have your own library of routines to be used for autocall, then you could issue a GLOBAL TXTLIB command that specifies your TXTLIB before invoking COOL with the CICS option. For example

GLOBAL TXTLIB yourlib
COOL ftoc (CICS)

Alternatively, you could specify all the libraries to be used for autocall:

GLOBAL TXTLIB yourlib LC370CIC LC370BAS
COOL ftoc

You can also use the CMS GLOBALV command to create a default list of TXTLIBs that need to be global when COOL is invoked. The COOL EXEC queries the TXTLIBS variable in the group LC370 to determine whether any default TXTLIBs have been specified. The EXEC retains the current GLOBAL TXTLIBs before issuing a new GLOBAL command to be used during the invocation of COOL. It then restores the saved global TXTLIBs after COOL has terminated.

For example, the following CMS GLOBALV command specifies that the yourlib TXTLIB be made global when COOL is invoked. Because the CICS option is specified, the LC370CIC and LC370BAS TXTLIBs are also made global.

GLOBALV SELECT LC370 SETL TXTLIBS yourlib
CLIN ftoc (CICS)

The COOL EXEC accepts the NOGLOBAL option. If this option is used, the EXEC does not query the GLOBALV variable TXTLIBS for the names of TXTLIBs that are to be global before COOL begins execution.


Chapter Contents

Previous

Next

Top of Page

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