Example 2. all C parts built with XPLINK

The second example is a variation of the first example. The purpose of this example is to show how easy it is to build an application with both XPLINK and IPA. To simplify the options even more, this example will not generate any listings. Please refer to the appropriate sections of Example 1. all C parts to map the given names to the members of the SCCNSAM data set.

Building example 2. under z/OS UNIX System Services

The only addition to the IPA compile step is the required addition of the XPLINK option. The GOFF option has also been added (this option defaults on when XPLINK is specified) for convenience purposes.
c89 -c -2 -WI,NOOBJECT -Wc,XPLINK,GOFF hello1.c hello2.c hello3.c
For the IPA link step, the changes are similar to the compile step, and the basic changes that must be done to use XPLINK under z/OS® UNIX System Services. The option -Wl,XPLINK is added to guide c89 to include the XPLINK libraries in the IPA link step.
c89 -2 -WI,LEVEL\(2\) -Wl,XPLINK -o hello hello1.o
  hello2.o hello3.o

Building example 2. in batch

In batch, the same basic changes are made. XPLINK and GOFF are added to the IPA compile steps and the XPLINK proc EDCXI is used instead of EDCI. A few extra includes (CELHS003,CELHS001) are placed in the IPA input to allow IPA to resolve XPLINK library references. This job will result in an object deck that can then be linked to create the module.
//USERID1A JOB (127A,0329),'$MEM$',                                     
//  MSGLEVEL=(2,0),MSGCLASS=S,CLASS=A,                                  
//  NOTIFY=USERID1,REGION=1024M                                         
//PROC JCLLIB ORDER=(CBC.SCCNPRC)                          
//*-------------------------------------------------------------------- 
//* IPA compile step for hello1.c                                       
//*-------------------------------------------------------------------- 
//C001F336  EXEC EDCC,                                                  
//          INFILE='USERID1.IPA.SOURCE(HELLO1)',                        
//          OUTFILE='USERID1.IPA.OBJECT(HELLOX1),DISP=SHR',             
//          CPARM='OPTFILE(DD:OPTIONS)'                                 
//OPTIONS  DD *                                                         
    IPA(NOOBJECT) RENT LONG OPT(2) XPLINK GOFF                          
/*                                                                      
//*-------------------------------------------------------------------- 
//* IPA compile step for hello2.c                                       
//*-------------------------------------------------------------------- 
//C001F336  EXEC EDCC,                                                  
//          INFILE='USERID1.IPA.SOURCE(HELLO2)',                        
//          OUTFILE='USERID1.IPA.OBJECT(HELLOX2),DISP=SHR',             
//          CPARM='OPTFILE(DD:OPTIONS)'                                 
//OPTIONS  DD *                                                         
    IPA(NOOBJECT) RENT LONG OPT(2) XPLINK GOFF                          
/*                                                                      
//*-------------------------------------------------------------------- 
//* IPA compile step for hello3.c                                       
//*-------------------------------------------------------------------- 
//C001F336  EXEC EDCC,                                                 
//          INFILE='USERID1.IPA.SOURCE(HELLO3)',                       
//          OUTFILE='USERID1.IPA.OBJECT(HELLOX3),DISP=SHR',            
//          CPARM='OPTFILE(DD:OPTIONS)'                                
//OPTIONS  DD *                                                        
    IPA(NOOBJECT) RENT LONG OPT(2) XPLINK GOFF                         
/*                                                                     
//*--------------------------------------------------------------------
//* IPA link step for the hello module                                 
//*--------------------------------------------------------------------
//C001F336  EXEC EDCXI,                                                
//          OUTFILE='USERID1.IPALINK.OBJECT(HELLOXP),DISP=SHR',        
//          IPARM='OPTFILE(DD:OPTIONS)'                                
//* The following line sets up an input file that just includes all    
//*   the IPA compile step object files.                               
//SYSIN  DD DATA,DLM='/>'                                              
  INCLUDE OBJECT(HELLOX1,HELLOX2,HELLOX3)                              
  INCLUDE SYSLIB(CELHS003,CELHS001)                                    
/>                                                                                            
//* These are the options used                                         
//OPTIONS  DD DATA,DLM='/>'                                            
    IPA(LINK,LEVEL(2)) OPT(2) RENT LONGNAME                            
    XPLINK GOFF                                                        
/>                                                                     
//* The following line gives the object library                        
//OBJECT DD DSN=USERID1.IPA.OBJECT,DISP=SHR