XML Toolkit for z/OS FAQS

 

 

Building XML Samples for Native MVS using JCL

The samples which are included in the XML Toolkit for z/OS reside in the product HFS and may be compiled and linked into either an HFS or into a PDSE dataset depending upon your preference. However, the instructions provided only deal with building the samples from the HFS using the gmake utility under Unix System Services (USS). Alternatively, it is possible to copy the sample C++ source code and header files to PDSE datasets and compile and link-edit them from TSO using JCL instead of using gmake from USS. However, all of the header files needed from the XML Toolkit will still have to be picked up out of the product HFS because of their long names and hierarchical structure.

In order to illustrate an application whose source code resides in datasets, we will use the source and header files for the SAXCount sample which reside in the

/usr/lpp/ixm/IBM/xml4c-5_5/samples/SAXCount
directory and copy them to datasets.

You first need to allocate the following PDSE datasets:

[userid].BATCH.CPP -- recfm=FB, lrecl=240, blksize=12960
[userid].BATCH.HPP -- recfm=FB, lrecl=240, blksize=12960
[userid].BATCH.JCL -- recfm=FB, lrecl=80, blksize=12960
[userid].BATCH.OBJ -- recfm=FB, lrecl=80, blksize=12960
[userid].BATCH.LOAD -- recfm=U, lrecl=0, blksize=32760
Then you need to copy the SAXCount.cpp and SAXCountHandlers.cpp files to the [userid].BATCH.CPP PDSE. Since the member names in a PDSE may not exceed 8 characters, you will need to rename the SAXCountHandler.cpp part to SAXCONTH. For SAXCount.cpp, you can just use a member name of SAXCOUNT. Since files in the HFS can have more than 80 byte records in them, a logical record length of 240 is used here to avoid truncating any code.

The corresponding header files (SAXCount.hpp and SAXCountHandlers.hpp) also need to be copied to the [userid].BATCH.HPP PDSE. Use SAXCONTH for the member name for the SAXCountHandlers.hpp member here too.

Once you have copied all of these files, you need to edit the SAXCOUNT member of the [userid].BATCH.HPP PDSE and change the following line:

#include "SAXCountHandlers.hpp"
to:
#include "SAXConth.hpp"
This is so that this refers to the 8 character name we copied this file to in the PDSE.

The next step is to copy the following JCL to the [userid].BATCH.JCL PDSE. This JCL will compile the SAXCOUNT and SAXCONTH members and store the object files in [userid].BATCH.OBJ.

//COMPILE  JOB MSGLEVEL=(1,1),REGION=0M,NOTIFY=&SYSUID.              
//JOBLIB   DD  DSNAME=SYS1.CEE.SCEERUN,DISP=SHR                      
//         DD  DSNAME=SYS1.CEE.SCEERUN2,DISP=SHR                     
//         DD  DSNAME=SYS1.CBC.SCCNCMP,DISP=SHR                      
//STEP1    EXEC  PGM=CCNDRVR,PARM='/CXX OPTFILE(DD:OPTS),OBJ,LIST'   
//OPTS     DD  *                                                     
  LANGLVL(EXTENDED)                                                  
  NOSEARCH SEARCH(                                                   
          /usr/lpp/ixm/IBM/xml4c-5_5/include/,                              
          //'[userid].BATCH.+',                                        
          //'SYS1.CEE.SCEEH.+',                                      
          //'SYS1.CBC.SCLBH.+')                                      
  DEFINE(OS390=1)                                                    
  DEFINE(_OPEN_THREADS=1)                                            
  DEFINE(_XOPEN_SOURCE_EXTENDED=1)                                   
/*                                                                   
//SYSLIN   DD  DSNAME=&SYSUID..BATCH.OBJ(SAXCOUNT),DISP=SHR          
//SYSPRINT DD  SYSOUT=A                                              
//SYSIN    DD  DSNAME=&SYSUID..BATCH.CPP(SAXCOUNT),DISP=SHR          
//SYSUT1   DD  DUMMY                                                 
/*                                                                   
//STEP2    EXEC  PGM=CCNDRVR,PARM='/CXX OPTFILE(DD:OPTS),OBJ,LIST'
//OPTS     DD  *                                                  
  LANGLVL(EXTENDED)                                               
  NOSEARCH SEARCH(                                                
          /usr/lpp/ixm/IBM/xml4c-5_5/include/,                           
          //'[userid].BATCH.+',                                     
          //'SYS1.CEE.SCEEH.+',                                   
          //'SYS1.CBC.SCLBH.+')                                   
  DEFINE(OS390=1)                                                 
  DEFINE(_OPEN_THREADS=1)                                         
  DEFINE(_XOPEN_SOURCE_EXTENDED=1)                                
/*                                                                
//SYSLIN   DD  DSNAME=&SYSUID..BATCH.OBJ(SAXCONTH),DISP=SHR       
//SYSPRINT DD  SYSOUT=A                                           
//SYSIN    DD  DSNAME=&SYSUID..BATCH.CPP(SAXCONTH),DISP=SHR       
//SYSUT1   DD  DUMMY                                              
/*
In this JCL, if you allocated the datasets with your TSO userid and run from that ID you can leave �&SYSUID.� as the high-level qualifier. In the compiler options (under the OPTS DD statement), you need to change [userid] to the high-level qualifier of the [userid].BATCH.HPP dataset. If your system does not use the �SYS1� prefix on the CEE.SCEEH and CBC.SCLBH datasets, you need to remove that qualifier also. What this SEARCH option does is instruct the compiler to first look in
/usr/lpp/ixm/IBM/xml4c-5_5/include/
for header files, then in the [userid].BATCH.HPP dataset, etc.

The options could actually be stored in a dataset and that dataset name used on the OPTS DD statement but the options are shown here to make the example complete. You can submit this job and it will create the SAXCOUNT and SAXCONTH object files in the [userid].BATCH.OBJ PDSE.

The next step is to link-edit (bind) these object files into an executable file. You can use the following JCL to accomplish this:

//BIND     JOB MSGLEVEL=(1,1),REGION=0M,NOTIFY=&SYSUID.  
//BIND1 EXEC PGM=IEWL,PARM='OPTIONS=OPTS'                
//OPTS     DD *                                          
    AMODE=31,RMODE=ANY                                   
    DYNAM=DLL,ALIASES=NO,UPCASE=NO,                      
    LIST=NO,MAP=NO,XREF=NO,MSGLEVEL=4,                   
    REUS=RENT,EDIT=YES,AC=0,CALL=YES,CASE=MIXED          
/*                                                       
//SYSLIB   DD DISP=SHR,DSN=SYS1.CEE.SCEELKEX             
//         DD DISP=SHR,DSN=SYS1.CEE.SCEELKED             
//         DD DISP=SHR,DSN=SYS1.CEE.SCEECPP              
//         DD DISP=SHR,DSN=SYS1.CBC.SCLBSID              
//SYSLIB1  DD DISP=SHR,DSN=SYS1.SIXMEXP             
//SYSLIB2  DD DISP=SHR,DSN=&SYSUID..BATCH.OBJ            
//SYSLMOD  DD DISP=SHR,DSN=&SYSUID..BATCH.LOAD           
//SYSDEFSD DD DUMMY                                      
//SYSPRINT DD SYSOUT=A                                   
//SYSLIN   DD *                                          
      INCLUDE SYSLIB(IOSTREAM)                           
      INCLUDE SYSLIB(COMPLEX)                            
      INCLUDE SYSLIB1(IXM4C55X)                          
      INCLUDE SYSLIB2(SAXCOUNT)                          
      INCLUDE SYSLIB2(SAXCONTH)                          
      ENTRY   CEESTART                                   
      NAME    SAXCOUNT(R) RC=0   
/*
In this JCL, you can also leave �&SYSUID.� there as long as you are running this from your TSO ID and it matches the high-level qualifier you allocated these datasets under. On the SYSLIB DD statements, if �SYS1� is not the high-level qualifier for these datasets, you will need to remove or replace that. The SYSLIB1 DD statement assumes the side-decks for the XML Toolkit were installed as recommended and they are in SYS1.SIXMEXP. You can submit this JCL and it should link-edit the SAXCOUNT and SAXCONTH object files into a single executable file called SAXCOUNT in [userid].BATCH.LOAD.

If you want to execute the SAXCOUNT executable, you can use the following JCL:

//SAXCOUNT JOB MSGLEVEL=1,REGION=0M,NOTIFY=&SYSUID. 
//JOBLIB   DD   DSN=SYS1.SIXMLOD1,DISP=SHR 
//         DD   DSN=&SYSUID..BATCH.LOAD,DISP=SHR    
//TEST1    EXEC PGM=SAXCOUNT,                       
//    PARM='//usr/lpp/ixm/IBM/xml4c-5_5/samples/data/personal.xml� 
/*
This JCL assumes that the XML Toolkit DLLs were installed as recommended to the SYS1.SIXMLOD1 dataset.

 

 

Building XSLT Processor, C++ Edition Samples for Native MVS using JCL

The samples for the XSLT Processor, C++ Edition, may also be built using JCL. This is very similar to the process for building the XML Parser, C++ Edition samples. You should review that section first. You will need to allocate the same MVS datasets. For the XSLT Processor, we will use the SimpleTransform sample as an example. This resides in the

/usr/lpp/ixm/IBM/xslt4c-1_9/samples/SimpleTransform
directory.

The first thing you need to do is copy the SimpleTransform.cpp file to the [userid].BATCH.CPP PDSE. Since the member names in a PDSE may not exceed 8 characters, you will need to slightly rename the SimpleTransform.cpp part to SMPLTRNS.

The corresponding header file (XalanMemoryManagerImpl.hpp) also needs to be copied to the [userid].BATCH.HPP PDSE. Use XALANMMI for the 8 character member name.

Once you have copied all of these files you need to edit the SMPLTRNS member of the [userid].BATCH.CPP PDSE and change the following line:

#include "XalanMemoryManagerImpl.hpp"
to
#include "XalanMMI.hpp"
This is so that this refers to the 8 character name we copied this header file to in the PDSE. The next step is to copy the following JCL to the [userid].BATCH.JCL PDSE. This JCL will compile the SMPLTRNS member and store the object file in [userid].BATCH.OBJ.
//SMPTCOMP    JOB MSGLEVEL=(1,1),REGION=0M,NOTIFY=&SYSUID.              
//JOBLIB   DD  DSNAME=SYS1.CEE.SCEERUN,DISP=SHR                      
//         DD  DSNAME=SYS1.CEE.SCEERUN2,DISP=SHR                     
//         DD  DSNAME=SYS1.CBC.SCCNCMP,DISP=SHR                      
//STEP1    EXEC  PGM=CCNDRVR,PARM='/CXX OPTFILE(DD:OPTS),OBJ,LIST'   
//OPTS     DD  *                                                     
  LANGLVL(EXTENDED)                                                  
  NOSEARCH SEARCH(./,                                                
          /usr/lpp/ixm/IBM/xml4c-5_5/include/,                       
          /usr/lpp/ixm/IBM/xslt4c-1_9/include/,                      
          /usr/lpp/ixm/IBM/xslt4c-1_9/include/xalanc/Include/,       
          /usr/lpp/ixm/IBM/xslt4c-1_9/include/xalanc/XSLT,           
          //'[userid].BATCH.+',                                        
          //'SYS1.CEE.SCEEH.+',                                      
          //'SYS1.CBC.SCLBH.+')                                      
  DEFINE(OS390=1)                                                    
  DEFINE(_OPEN_THREADS=1)                                            
  DEFINE(_XOPEN_SOURCE_EXTENDED=1)                                   
/*                                                                   
//SYSLIN   DD  DSNAME=&SYSUID..BATCH.OBJ(SMPLTRNS),DISP=SHR          
//SYSPRINT DD  SYSOUT=A                                              
//SYSIN    DD  DSNAME=&SYSUID..BATCH.CPP(SMPLTRNS),DISP=SHR          
//SYSUT1   DD  DUMMY                                                 
/*                                                            
The next step is to link-edit (bind) this object file into an executable file. You can use the following JCL to accomplish this:
//SMPTBIND JOB MSGLEVEL=(1,1),REGION=0M,NOTIFY=&SYSUID.       
//BIND1 EXEC PGM=IEWL,PARM='OPTIONS=OPTS'                     
//OPTS     DD *                                               
    AMODE=31,RMODE=ANY                                        
    DYNAM=DLL,ALIASES=NO,UPCASE=NO,                           
    LIST=NO,MAP=NO,XREF=NO,MSGLEVEL=4,                        
    REUS=RENT,EDIT=YES,AC=0,CALL=YES,CASE=MIXED               
/*                                                            
//SYSLIB   DD DISP=SHR,DSN=SYS1.CEE.SCEELKEX                  
//         DD DISP=SHR,DSN=SYS1.CEE.SCEELKED                  
//         DD DISP=SHR,DSN=SYS1.CEE.SCEECPP                   
//         DD DISP=SHR,DSN=SYS1.CEE.SCEELIB                   
//         DD DISP=SHR,DSN=SYS1.CBC.SCLBSID                   
//SYSLIB1  DD DISP=SHR,DSN=SYS1.SIXMEXP                  
//SYSLIB2  DD DISP=SHR,DSN=&SYSUID..BATCH.OBJ                 
//SYSLMOD  DD DISP=SHR,DSN=&SYSUID..BATCH.LOAD                
//SYSDEFSD DD DUMMY                                           
//SYSPRINT DD SYSOUT=A                                        
//SYSLIN   DD *                                               
      INCLUDE SYSLIB(IOSTREAM)                                
      INCLUDE SYSLIB(COMPLEX)                                 
      INCLUDE SYSLIB(C128N)                                   
      INCLUDE SYSLIB1(IXM4C55X)                               
      INCLUDE SYSLIB1(IXMLC19X)                               
      INCLUDE SYSLIB2(SMPLTRNS)                               
      ENTRY   CEESTART                                        
 Command ===>                                                 
      NAME    SMPLTRNS(R) RC=0
/*
In this JCL, you can also leave �&SYSUID.� there as long as you are running this from your TSO ID and it matches the high-level qualifier you allocated these datasets under. On the SYSLIB DD statements, if �SYS1� is not the high-level qualifier for these datasets you will need to remove or replace that. The SYSLIB1 DD statement assumes the side-decks for the XML Toolkit were installed as recommended and they are in SYS1.SIXMEXP. You can submit this JCL and it should link-edit the SMPLTRNS object file into an executable file called SMPLTRNS in [userid].BATCH.LOAD.

If you want to execute the SAXCOUNT executable, you can use the following JCL:

 

//SMPLTRNS JOB  MSGLEVEL=(1,1),CLASS=5,REGION=0M,NOTIFY=&SYSUID. 
//STEP1    EXEC PGM=SMPLTRNS                                     
//STEPLIB  DD   DSN=&SYSUID..BATCH.LOAD,DISP=SHR                   
//         DD   DSN=SYS1.SIXMLOD1,DISP=SHR                     
//*                                                      
This JCL assumes that the XML Toolkit DLLs were installed as recommended to the SYS1.SIXMLOD1 dataset.

Contact IBM

Browse z/OS