Installing C application programs

Figure 20 shows the flow of control in the DFHYxTzL cataloged procedures for C command-level programs.

Figure 20. Installing C programs using the DFHYxTzL procedure
 This diagram shows the flow through the steps of the DFHYxTzL procedure, as described in the text.

There are translator, compiler, pre-linkage editor and linkage editor steps, each producing a listing and an intermediate file that is passed to the next step. C libraries are referenced in the compiler, pre linkage editor and linkage editor steps.

Note:
Start of change
When you choose the XPLINK compiler option, there is no pre-link step in the diagram above.
End of change

Before you can install any C programs, you must have installed the C library and compiler and generated CICS® support for C. (See the CICS Transaction Server for z/OS® Installation Guide.)

Sample JCL to install C application programs

You can use the job control statements shown in Figure 21 to process C application programs. In the procedure name, x depends on whether your program is a CICS application program or an EXCI batch program. For the names of the CICS-supplied procedures, see Table 6.

Figure 21. Sample JCL to call the DFHYxTzL procedures
//jobname    JOB  accounting info,name,MSGLEVEL=1
//           EXEC PROC=DFHYxTzL                                 1 
//TRN.SYSIN  DD      *                                          2 
#pragma XOPTS(Translator options . . .)                         3 
              .
             C source statements
              .
/*
//LKED.SYSIN DD      *                                          4 
               NAME    anyname(R)
/*
//
where anyname is your load module name

Notes for installing a C program:

 1  Compiler options:

You can code compiler options by using the parameter override (PARM.C) in the EXEC statement that invokes the procedure, or on a ~pragma options directive.

 2  If you have no input for the translator, you can specify DD DUMMY instead of DD *. However, if you specify DD DUMMY, also code a suitable DCB operand. (The translator does not supply all the data control block information for the SYSIN data set.)

 3  Translator options: For information about the translator options you can include on the XOPTS statement, see Defining translator options .

 4  If you are installing a program into either of the read-only DSAs, see Running application programs in the RDSAs for more details.

If you are installing a program that is to be used from the LPA, add the RENT and REFR options to the LNKPARM parameter on the call to the DFHYxTzL procedure. (See Running applications in the link pack area for more information.)

C language programs must be link-edited with AMODE(31), so the DFHYxTzL procedures specify AMODE(31) by default.

Start of changeTo use the procedures to invoke the integrated translator for XL C, you can use the job control statements shown in Figure 22:

Figure 22. Sample job control statements to invoke the integrated translator for XL C
 //jobname    JOB  accounting info,name,MSGLEVEL=1
 //           EXEC DFHZITxL,PROGLIB=dsnname                    1 
 //C.SYSIN  DD *                        
    .                                       
    . C source statements                   
    .                                       
                                  
 //LKED.SYSIN DD *                          
             NAME anyname(R)                                                  
                                    
 //
                                           
where anyname is your load module name.
End of change

Start of change 1  Translator name:End of change

Start of changeSpecify DFHZITDL for C programs without XPLINK or DFHZITFL for C programs with XPLINK.End of change

Start of changeTo use the procedures to invoke the integrated translator for XL C++, you can use the job control statements shown in Figure 23:

Figure 23. Sample job control statements to invoke the integrated translator for XL C++
 //jobname    JOB  accounting info,name,MSGLEVEL=1
 //           EXEC DFHZITxL,PROGLIB=dsnname                    1 
 //CPP.SYSIN  DD *                        
    .                                       
    . C++ source statements                   
    .                                       
                                  
 //LKED.SYSIN DD *                          
             NAME anyname(R)                                                  
                                    
 //
                                           
where anyname is your load module name.
End of change

Start of change 1  Translator name:End of change

Start of changeSpecify DFHZITEL for C++ programs without XPLINK, or DFHZITGL for C++ programs with XPLINK.End of change

Including pre-translated code with your C source code

The translator may generate dfhexec or DFHEXEC. If both versions are present in your program, you will see error message IEW2456E. There are two ways to prevent this error.

  1. Recompile the old code containing dfhexec.
  2. Use the prelinker RENAME control statement in the job, as shown below.
Figure 24. Sample JCL to rename dfhexec
//jobname    JOB  accounting info,name,MSGLEVEL=1
//           EXEC PROC=DFHYxTzL                                
//TRN.SYSIN  DD      *                                         
#pragma XOPTS(Translator options . . .)                        
              .
             C source statements
              .
/*
//PLKED.SYSLIN DD      *  
         RENAME dfhexec DFHEI1 
//LKED.SYSLIN DD      *  
         NAME anyname(R) 
/*
//
where anyname is your load module name
[[ Contents Previous Page | Next Page Index ]]