4.1.2.4.2 C Compiler Example
Compile and pre-link your C language source. The Oracle Tuxedo Mainframe Adapter for SNA installation library contains C language compiler examples. The following listing shows a C/MVS compiler example.
In this example, the external storage variables must be re-entrant in the load module for the CICS/ESA environment. Additionally, the C language source contains long variable and function names. The pre-link step must be run to resolve the long names and create re-entrant variables from the compiled object. Perform the pre-link step, use the RENT option in the compile program, and use the compile output in the link-edit step.
Listing C/MVS Compiler Example
//*----------------------------------------
//* COMPILE STEP:
//*----------------------------------------
//COMPILE EXEC PGM=CBC310,REGION=2M,COND=(7,LT,TRN),
// PARM=(‘OPT(1),LONGNAME,RENT,SOURCE’)
//STEPLIB DD DSNAME=SYS1.SCEERUN,DISP=SHR
// DD DSNAME=SYS1.SCBC3CMP,DISP=SHR
//SYSMSGS DD DSNAME=SYS1.SCBC3MSG(EDCMSGE),DISP=SHR
//SYSIN DD DSNAME=&&SYSCIN,DISP=SHR **FROM TRN STEP
//SYSLIB DD DSNAME=SYS1.SCEEH.H,DISP=SHR
// DD DSNAME=SYS1.SCEEH.SYS.H,DISP=SHR
// DD DSNAME=CICSxxx.SDFHC370,DISP=SHR**CPIC
// REQUIRED**
//SYSLIN DD DSNAME=&&PLNKSET,UNIT=VIO,
// DISP=(MOD,PASS),SPACE=(TRK,(3,3)),
// DCP=(RECFM=FG,LRECL=80,BLKSIZE=&SYSLBLK)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSCPRT DD SYSOUT=*
//SYSUT1 DD UNIT=VIO,SPACE=(32000,(30,30,)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200
//SYSUT4 DD UNIT=VIO,SPACE=(32000,(30,30,)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200
//SYSUT5 DD UNIT=VIO,SPACE=(32000,(30,30,)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=12800
//SYSUT6 DD UNIT=VIO,SPACE=(32000,(30,30,)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=12800
//SYSUT7 DD UNIT=VIO,SPACE=(32000,(30,30,)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=12800
//SYSUT8 DD UNIT=VIO,SPACE=(32000,(30,30,)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=12800
//SYSUT9 DD UNIT=VIO,SPACE=(32000,(30,30,)),
// DCB=(RECFM=FB,LRECL=137,BLKSIZE=882
//SYSUT10 DD SYSOUT=*
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200
//SYSUT14 DD UNIT=VIO,SPACE=(32000,(30,30,)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=128007
//PLKED EXEC PGM=EDCPRLK,COND=((7.LT,C),(7,LT,TRN)),
// PARM=’MAP’
//STEPLIB DD DSN=SYS1.SCEERUN,DISP-SHR
//SYSMSGS DD DSN=SYS1.SCEEMSGP(EDCPMSGE),DISP+SHR
//SYSLIB DD DSN=&LE370HLQ..SCEECPP,DISP=SHR
// DD DUMMY
//SYSIN DD DSN=&&PLNKSET,DISP=(MOD,PASS)
//SYSMOD DD DSN=&&LOADSET,DISP=(,PASS),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
Parent topic: Compile the Translated Source File