WebSphere Studio Enterprise Developer 5.0 - Using XML Enablement


INTRODUCTION

This workshop will take you through the steps of using the XML Enablement component of WebSphere Studio Enterprise Developer 5.0 to create converter programs that will enable existing COBOL applications to process XML data.  The workshop will generate both inbound and outbound XML converters for
two of the programs described in the white paper "XML For the Enterprise" (which can be found in the directory C:\WS50STEW\hands-on\XML Enablement\white paper).

Note:  This workshop requires that the following products are installed: 
  • WebSphere Studio Enterprise Developer Early Availability Version 5.0

Section 1 - Generating XML Converters

___ 1. Create a new Simple Project

A current restriction of the XML Enablement tool is that MVS related projects cannot be the target of its output.  You will thus
create a local Simple Project for this workshop.

a.  Click File->New->Project, select Simple then Project from the New Project Select panel.

b.  On the New Project Project panel, give it a Project Name of XMLCONV and click Finish.

___ 2. Review the Preferences for XML Enablement
a. Click Window->Preferences to bring up the Preferences window..

The following is a description of each field:
 
Field
Description
Program name Stem (partial) value for the program name in the PROGRAM-ID paragraph of the COBOL converter programs.

For example, with the default value of XGEN, the inbound converter program will have a program name of XGENI while its outbound counterpart will have a program name of XGENO

Maximum number of characters allowable is 7. 

Author name Value for the AUTHOR paragraph of the COBOL converter programs.
Maximum message size (KB) Maximum size of the XML mesage that will need to be allocated when processing and generating the XML message.
Code page Code page to be used for the encoding of the inbound and outbound XML documents.
Decimal Point is Comma (checkbox) When selected, exchanges the functions of the period and the comma in PICTURE character strings and in numeric literals of a COBOL program.

You'll be leaving the defaults as is as you can override them for each specific generation.

___ 3. Import files DFH0ACTD.cbl and DFH0CSTD.cbl
The two programs you will be working with are called by a front-end interactive CICS program to provide account detail information (DFH0ACTD) and customer detail information (DFH0CSTD).

a. After creating your XMLCONV Simple  project, you should see something similar to the following in your Navigator (or z/OS Projects) view:


b.  From the Navigator view, highlight XMLCONV, click File on the menu bar, and select Import.

c.  On the Import Select panel, select File system and click Next>.

On the Import File system panel, click the Browse key and navigate to the
C:\WS50STEW\hands-on\XML Enablement\source folder and click OK. You
should see  source folder appear in the lower left pane of the panel.

Highlight the source folder (not the check box on its left) and the folder members should appear on the lower
right pane of the panel.  Scroll down until you can see both DFH0ACTD.cbl and DFH0CSTD.cbl.
Click the check box to the right of these members to select.  

Make sure the Create selected folders only is selected.


 

Verify that the Folder field shows XMLCONV.  If not, click the Browse button beside it,
select XMLCONV from the Folder Selection panel, and click OK.

Click Finish to complete the import.

Your Navigator view should  now look like the following:

___ 4. Examine DFH0ACTD.cbl
a. Double click on DFH0ACTD.cbl to edit it.

b. Explore its structure using the Outline view.

c. Examine the DFHCOMMAREA data structure in the LINKAGE SECTION as you will be dealing with this in a later step.


___ 5. Generate XML converters for DFH0ACTD.cbl

a. Highlight DFH0ACTD.cbl, click mouse button 2, select Enable XML, and select Generate XML converter.


 

b.  The first page of the Generate XML Converter wizard is used to specify input and output files.  The output files are the Converter, the XSD file (XML Schema), and the Converter driver.  By default, the wizard will prepend a C in front of the source file name to form the Converter file name and prepend a D to the front of the source file name to form the Converter driver file name.  For example, CDFH0ACTD.cbl and DDFH0ACTD.cbl.  Since the file names will now be greater than 8 characters long, you may run into problems when you try to move these into a z/OS partitioned dataset (PDS).

Override the Converter and Converter driver file names as follows:
 
Field Value
Converter file name ACTDCNV.cbl
Converter driver file name ACTDDRV.cbl

Click Next> to continue to the next page.

c.  The Generation options page looks fairly similar to the preferences for XML Enablement that you reviewed in an earlier step.  Remember that the Program name field allows you to specify a stem value to be used to create the PROGRAM-ID values for the inbound and outbound converter programs.  Override the default program name of XGEN with ACTDCNV.

Click Next> to continue.

d.  The third and final page of the wizard is where you specify the inbound and outbound data structures for which you want to generate the equivalent XML-based interface.  From a prior step where you explored DFH0ACTD.cbl, you know that DFHCOMMAREA is the data structure defined in the LINKAGE SECTION and thus will be one used for both input and output.

Select DFHCOMMAREA from the pull-down list of both Input data structure and Output data structure.

Click Finish to complete.

e.  Once generation is finished, your Navigator view should look something like this:

Notice the 3 additional files generated.  Use the built-in editors to explore those new files.  For example you can use XML schema editor to explore further the DFH0ACTD.xsd file.

Note also that the Converter driver program, ACTDDRV.cbl, is only a template and needs to be modified before run.

___ 6. Generate XML converters for DFH0CSTD.cbl
Use steps 4 and 5 as models to generate XML converters for DFH0CSTD.cbl.

a.  Examine DFH0CSTD.cbl and review DFHCOMMAREA in the LINKAGE SECTION.

b.  Start the Generate XML Converter wizard action on DFH0CSTD.cbl.

c. Override the Converter and Converter driver file names as follows:
 
Field Value
Converter file name CSTDCNV.cbl
Converter driver file name CSTDDRV.cbl

d.  Use CSTDCNV for the program name on the Generation options page of the wizard.

e.  Use DFHCOMMAREA as the input and output data structure. 

f.  After the generation is complete, your Navigator view should look similar to the following (note the 3 additional files 
generated:  CSTDCNV.cbl, CSTDDRV.cbl, and DFH0CSTD.xsd).

 

___ 7. Final notes
The XML converters use the xml language construct that was introduced in IBM Enterprise COBOL for z/OS and OS/390 Version 3 Release 1 as part of its XML support.  The COBOL compiler shipped with WebSphere Studo Enterprise Developer Early Availability Version 5.0 that is used for local syntax check has not yet been updated to the same level as the latest z/OS COBOL compiler.  Thus, you can only compile the XML converters generated here on a z/OS system that has the requisite COBOL compiler installed (DEMOMVS has this).
Congratulations, you have completed the Using XML Enablement Lab for WebSphere Studio Enterprise Developer Early Availability 5.0.