To create XML from application data or vice versa, you
create the mappings to describe how CICS will transform the data and
XML at run time. You can start from any application data record; for
example, you can start with a COMMAREA, VSAM file, temporary storage
queue, or a DB2 record.
Before you begin
Before you create the mappings, you must make sure that these
preconditions have been completed:
- You must have a language structure that describes the application
record in a partitioned data set. The language structure can be written
in any of the high-level languages supported by the CICS XML assistant:
COBOL, PL/I, C, and C++. If this mapping is for use with an Atom feed,
and you are using any of the fields in your application record to
provide metadata for the Atom entries (such as the name of an author),
make sure that those fields are not nested in your language structure.
You can have structures of nested fields within a field that provides
the content for an Atom entry.
- You must configure the user ID under which DFHLS2SC runs to use
z/OS UNIX.
- The user ID must have read permission to access the language structure
and write permission to put the output in the appropriate directories
on z/OS UNIX.
- You must allocate sufficient storage to the user ID for the ID
to run Java™. You can use any
supported version of Java. By default, DFHLS2SC uses the Java version
specified in the JAVADIR parameter.
About this task
Use the CICS XML assistant to create the data mappings for
the application record. For each high-level language supported by
the CICS XML assistant, a few types of data are restricted or not
supported. The CICS XML assistant issues error messages about any
unsupported items that it identifies in your language structure. The
reference information for the CICS XML assistant lists the restrictions
that apply to each high-level language.
Procedure
- Run the DFHLS2SC batch job.
DFHLS2SC has optional
parameters that you select to meet your requirements, such as selecting
a particular code page or a name space. Use the following parameters
as a minimum:
- Specify the high-level language of your language structure
in the LANG parameter.
- If you are deploying the data mappings in a bundle,
specify the name of a bundle resource in the BUNDLE parameter.
If you are creating an XML binding for an Atom feed, do not
specify this parameter.
- Specify the mapping level in the MAPPING-LEVEL parameter.
If you are creating an XML binding for an Atom feed, you must
use a mapping level of 3.0 or higher.
For other situations,
although you can use any mapping level, to get the most advanced mapping
options use the latest mapping level.
- Optional: If you are creating an XML binding
for an Atom feed, and your application data record contains timestamps
in CICS ABSTIME format, specify the optional parameter DATETIME=PACKED15 to
map these fields as timestamps.
- Specify the location and the code page of the language
structures that describe the application record in the PDSMEM and PDSCP parameters.
- Specify the name and location of the schema file in
the SCHEMA parameter.
The file extension
is .xsd. If you are creating a bundle, do not
specify a location. DFHLS2SC creates the XML schema, but not the directory
structure, if the file does not already exist.
- Specify the name and location of the XML binding in
the XSDBIND parameter.
The file extension
is
.xsdbind. If you are creating a bundle, do
not specify a location. DFHLS2SC creates the XML binding, but not
the directory structure, if the file does not already exist.
Tip: Put the XML binding and the schema in the same directory
structure to enable validation. Validation can be useful when you
are testing out your application in a development or test environment.
If you are creating a bundle, CICS puts the files in the same directory
for you.
If you specify the BUNDLE parameter,
the batch job creates a bundle directory structure on z/OS UNIX. The
bundle directory has a META-INF subdirectory that contains the bundle
manifest. The batch job also creates an XML schema and an XML binding
in the bundle directory, using the file names that you specified for
the SCHEMA and XSDBIND parameters.
If you do not specify the BUNDLE parameter, the
batch job creates the XML schema and XML binding only in the specified
location.
- Install the BUNDLE resource, or an ATOMSERVICE resource
that specifies this XML binding.
The BUNDLE and
ATOMSERVICE resources dynamically create an XMLTRANSFORM resource,
which defines the location of the XML schema and binding file.
Results
When you generate mappings from language structures, only
one XML transformation is possible.
Example
The following example shows DFHLS2SC with the minimum set
of parameters specified.//LS2SC JOB 'accounting information',name,MSGCLASS=A
// SET QT=''''
//JAVAPROG EXEC DFHLS2SC,
// TMPFILE=&QT.&SYSUID.&QT
//INPUT.SYSUT1 DD *
LANG=COBOL
BUNDLE=/u/exampleapp/bundle/test1
LOGFILE=/u/exampleapp/xsdbind/example.log
MAPPING-LEVEL=3.0
PDSLIB=//CICSHLQ.SDFHSAMP
PDSMEM=CPYBK2
XSDBIND=example.xsdbind
SCHEMA=example.xsd
/*
What to do next
Write an application program to transform the application
data to XML and vice versa. You can use the same mappings for both
transformations. If you have created an XML binding for an Atom feed,
continue with the steps to set up your Atom feed.