Using the SAS/C® CICS[TM] Command Preprocessor

Introduction

This chapter describes how to use the ccp command to request CICS services by placing CICS commands anywhere within your C or C++ source code. The ccp command translates the CICS commands into appropriate function calls for communication with CICS. By default, the name of the output file will be generated from the input name, with a .c suffix, unless the -o option is used.

Once the preprocessor has translated the CICS commands within your C or C++ program, you then compile and link-edit your program as you would any SAS/C program. When you run your SAS/C program, the function calls inserted by the preprocessor invoke the services requested by calling the appropriate CICS control program using the CICS EXEC Interface program.

Using the ccp Command

The SAS/C CICS Command Preprocessor can be invoked either directly or by the sascc370 or sasCC370 compiler driver.

Invoking ccp Directly

The following syntax is used to invoke ccp directly:

 ccp [options] in_file.ccp
The options that may be used are described in "Option Descriptions" on page 46.

The in_file.ccp specifies the name of the input file. By default, the name of the output file will be the input filename with a .c suffix, unless the -o option is used.

Using sascc370 or sasCC370 to Invoke ccp Automatically

If your source file suffix is .ccp, the compiler driver uses the ccp command to translate any CICS commands. The ccp command is invoked and the output is compiled, with either the C or C++ compiler. For example, the following command could be entered to compile the file named myfile.ccp:

 sascc370 -Tcics370 -Aclet myfile.cpp
In this case, myfile.ccp is preprocessed for CICS commands. The resulting file is compiled with the C compiler and linked with the CICS target libraries to produce a.out. The -Aclet option is necessary so that warning messages do not prevent the object file from being stored.

 sasCC370 -Tcicsvse -Aclet myfile.cpp
In this case, myfile.ccp is preprocessed for CICS commands. The resulting file is compiled with the C++ compiler and linked with the CICS VSE library to produce a.out. The -Aclet option is necessary so that warning messages do not prevent the object file from being stored.

To pass options to the CICS preprocessor during compilation with sascc370 or sasCC370, specify the compilation phase prefix, -WP, followed by the CICS option. For example, this command compiles myfile.cpp and passes the CICS -d option to the CICS preprocessor:

 sascc370 -Tcics370 -WP,-d myfile.cpp
The options that may be used are described in the section "Option Descriptions" on page 46.

Linking CICS Preprocessed Files

You must use the -Tcics370 or -Tcicsvse options on the compiler driver to cause cool to use the CICS or CICS VSE target libraries. However, if you are using the CICS external call interface (-x option), you should link with the standard resident library, STDOBJ, instead of the CICS libraries.

Note: When you use cool to link a CICS application, you will receive warnings about unresolved references to the following: DFHEI1, DFHEAI, and DFHAI0. These warning messages are expected. As shown in the examples above, you should use the cool option -Aclet to allow the object file to be stored anyway. The output object file from cool must subsequently be moved to the target mainframe and linked with the CICS Execution Interface stubs.

Option Descriptions

This section provides a description of each of the options recognized by the ccp command.

Note: To negate most of these options, precede the option with ! instead of -. For example, to disable -c, use !c.

 -a N,M
adds sequence numbers to the output file. N specifies the first sequence number and M the incrementing value. If both N and M are 0, then the output file is not sequenced. The default for both M and N is 0. The -a N,M option is equivalent to the mainframe CICS preprocessor OUTSEQ option.

Note: Since the cross-platform compiler does not support sequence numbers, you cannot use the -a option if you intend to compile the preprocessor output on UNIX.

 -b 
enabled by default, causes the CICS preprocessor to produce code for the Execution Diagnostic Facility (EDF). The -b option is equivalent to the mainframe CICS preprocessor DEBUG option.

 -c 
enabled by default, indicates the preprocessor should translate EXEC CICS commands. The -c option is equivalent to the mainframe CICS preprocessor CICS option.

 -d 
causes the CICS preprocessor to process EXEC DLI commands. The -d option is equivalent to the mainframe CICS preprocessor DLI option.

 -e 
allows interception of all commands by the EDF. The -e option is equivalent to the mainframe CICS preprocessor EDF option.

 -f x
emits message only of level x and above, x may be: I (notes), W (warnings), E (errors) or S (sever errors). The default is -f I. The -f x option is equivalent to the mainframe CICS preprocessor FLAG option.

 -g 
shows C code generated for commands in the source listing. The -g option is equivalent to the mainframe CICS preprocessor EXPAND option.

 -i 
lists the CICS preprocessor options in effect on the listing file. The -i option is equivalent to the mainframe CICS preprocessor OPTIONS option.

 -j 
results in uppercased C keywords (VOID, INT, and so on) in the command translation. This is intended for use with the compiler's japan option. The -j option is equivalent to the mainframe CICS preprocessor JAPAN option.

 -l filename 
produces a CICS preprocessor listing named filename. The -l filename option is equivalent to the mainframe CICS preprocessor PRINT option.

 -m 
indicates that the BMS maps were generated specifically for C language programs, which is supported in CICS/ESA 3.3 and later. The preprocessor generates different default values for the FROM option of the SEND MAP command and the TO option of the RECEIVE MAP command depending on the presence (or absence) of this option. If the TO and FROM options are always explicitly coded, this option has no effect. The -m option is equivalent to the mainframe CICS preprocessor CBMSMAPS option.

 -n 
handles nested comments. The -n option is equivalent to the mainframe CICS preprocessor COMNEST option.

 -o filename 
writes the preprocessed output to the named file. This option cannot be negated.

 -p 
generates a prototype for ccp_exec_cics for each call to the EXEC command interface function. This is enabled by default. The -p option is equivalent to the mainframe CICS preprocessor PROTO option.

 -r N 
specifies the LRECL of the CICS preprocessor output file. N may be in the range 40 to 255, inclusive. The default is 255. The -r N option is equivalent to the mainframe CICS preprocessor OUTLRECL option.

 -x 
enables the CICS external call interface. This option allows a non-CICS program that is running on MVS to call a CICS program that is running in a CICS region. The non-CICS program can be translated, compiled, and pre-linked under UNIX, but the final link-editing must take place on MVS. For example, this command prepares a program that uses the CICS external call interface for final link-editing on MVS:

     sascc370 -WP,-x -WP,-m -Krent -Aclet myfile.cpp
Since the object shipped from UNIX is pre-linked, you should specify the mainframe COOL option NOCOOL to run only the linkage-editor.

The -x option is equivalent to the mainframe CICS preprocessor EXCI option. For details on the CICS external call interface, see the SAS/C CICS User's Guide, Second Edition.

Note: When using the CICS external call interface, the program must be linked with the standard resident library, STDOBJ, and not the CICS library.

 -z 
defines the number of lines per page in the listing file. The default is 60. The -z option is equivalent to the mainframe CICS preprocessor PAGESIZE option.