S 274
S 274
S 274
fm
pulling from a centralized repository that is delivered through the SMP/E process. The
configurable server architecture allows parts of the server architecture to remain in read-only
mode. More disk space can be added with increasing web service demands without
impacting the server operations. Advanced Installation Support by using the IBM Installation
Manager for z/OS
/usr/lpp/InstallationManager/V1R4
170
8174ch04.fm
1. The directory where SOAP Gateway is installed must be writeable because users need to
add web services, and the server log file is updated. Crucial server files therefore cannot
be mounted in READ only mode to prevent alterations.
2. As more web services are deployed and the server continues to run, user files and log files
could consume critical server space, and therefore slow down the server.
3. Installation of multiple copies of the SOAP Gateway server typically requires the use of
MVS DUMP, copytree, or PAX, and it is difficult to install from one managed copy.
In Version 2.2, the SOAP Gateway installation is divided into three components: imsserver,
imsbase, and imssoap. imsserver contains the server executable code, tools, and scripts.
Files in this component should never be altered. imsbase contains the server configuration
information, default log directory, and scratch directories. imssoap contains users' service
artifacts, such as web service WSDL files, correlator files, connection bundles, and
WS-Security configurations. See Figure 5-5.
171
8174ch04.fm
172
8174ch04.fm
A repository contains a repository.config file that stores the metadata on how to install and lay
out the selected packages on the system.
More and more IBM z/OS products are using IBM Installation Manager for z/OS, including
WebSphere Application Server for z/OS.
See videos of the installation process starting at:
http://www.youtube.com/watch?v=uiOZKtyXJ8c
173
8174ch04.fm
After you RECEIVE, APPLY, and ACCEPT the FMIDs, the second step is to install the
Installation Manager.
Before the installation, you need to apply PTF UK79476 to upgrade to V 1.5.3 of
the.Installation Manager. The version of the Installation Manager included in your order is an
older version and it must be upgraded. Then you can install the Installation Manager by
editing and submitting the provided sample jobs.
After the Installation Manager is installed, you can use the Installation Manager Command
Line imcl command to install SOAP Gateway by pointing to the SOAP Gateway repository.
See Figure 5-7
Remember that there are three installation components, imsserver, imsbase, and imssoap.
For each of these components, its installation directory or mount point must be specified.
Example 5-4 shows part of the AEWTSGCF sample job provided in the Base Services that
you can edit and submit to configure the installation directory. Instructions are provided in the
sample job for parameters that you must customize.
Example 5-4 AEWTSGCF sample
AEWTSGCF
//* 1) If you are installing SOAP Gateway on multiple mount
//*
points:
//*
a) Replace -ServerPathPrefix- with the path to install
//*
the imsserver component
174
*/
*/
*/
*/
8174ch04.fm
//*
b) Replace -BasePathPrefix- with the path to install
//*
the imsbase component
//*
c) Replace -SoapPathPrefix- with the path to install
//*
the imssoap component
//*
These directories are created and mounted in sample job
//*
AEWTSGAL.
ServerPathPrefix=-ServerPathPrefixBasePathPrefix=-BasePathPrefixSoapPathPrefix=-SoapPathPrefixIMPathPrefix=-IMPathPrefixRepoPath=ftp://driving.site.com/-RepoPathPrefixSharedResource=-SharedDirPath-
*/
*/
*/
*/
*/
*/
The Base Services include various sample jobs for SOAP Gateway installation for different
installation scenarios, and they are documented in the SOAP Gateway documentation in the
information center.
There are a few configuration steps you need to follow before you can start SOAP Gateway:
AEWPARMF
Sample job to copy the Java load module into the partitioned data set extended (PDSE)
used by SOAP Gateway.
AEWIOGBP
Sample job to specify the IBM Java SDK location and view the SOAP Gateway server
properties by using the SOAP Gateway management utility commands from BPXBATCH.
AEWIOGCF
Configuration member to configure SOAP Gateway runtime settings.
AEWIOGPR
JCL procedure for starting and stopping SOAP Gateway.
On the distributed platform you use the Installation Manager like always, only the deployment
utility has changed to Management Utility as shown in Figure 5-2 on page 167. Also the
directory is the same as described previously.
If you are a Unix person and dont like JCL, you may use the OMVS go to the imsserver
mount point to deploy. from here you are able to do the same as you do on the Windows
Management Utility. See Example 5-5 by using ./iogmgmt.
Example 5-5 mount point imsserver/deploy on OMVS
175
8174ch04.fm
1=Help
2=SubCmd
3=HlpRetrn
9=NextSess 10=Refresh
11=FwdRetr 12=Retrieve
4=Top
5=Bottom
6=TSO
7=BackScr
In Table 5-1, we see the different paths after migration from a previous SOAP Gateway to V22
Table 5-1 the different paths
176
server/webapps/imssoap/WEB-INF/classes/log4
j.properties
imsbase/conf/log4j.properties
8174ch04.fm
server/webapps/imssoap/imssoap.properties
imsbase/conf/imssoap.properties
N/A
imsbase/conf/native.env.propeties
env.properties
N/A
server/conf/server.xml
imsbase/conf/master/server.xml
server/webapps/imssoap/xml/(correlators)
imssoap/xml/(correlators)
server/webapps/imssoap/wsdl/(wsdls)
server/webapps/imssoap/WEB-INF/conf/
wsjaas.conf binary copy
server/webapps/imssoap/WS-SECURITY/
policy/bindings Binary Copy
imssoap/WEB-INF/wsjaas.conf
policy/bindings
server/webapps/imssoap/xml/connbundle
- >Binary Copy
imssoap/xml/connbundle.xml
177
8174ch04.fm
Transaction tracking
SOAP Gateway sends a tracking ID (up to 40 bytes) to IMS Connect on request and receives
the tracking ID back on response.
The unique tracking ID is generated by SOAP Gateway unless a user-defined tracking ID is
provided by the user as shown in Figure 5-7.
Configure SOAP Gateway to enable or disable tracking, as well as configure the tracking ID
type.
Example 5-7 Sample commands for trackingID
178
8174ch04.fm
Tracking ID
segment +
(XML) respons e
data + CSM
response
New
In
ES2.2
Tracking ID
In OTMA header
(user data secti on) +
bytes data
me ssage
ex it*
SOAP
Gateway
Request wi th
optional mess age ID
IMS
Connect
O
T
M
A
IMS
IMS App
Tracking ID
In OTMA header
(us er data secti on) +
T rack ing ID
bytes data
publi c
(JMX)
i nterface
R out e /
gen era te
T rackin g ID
ev ent
e xit *
Trac king ID
records events wi th
Tracking ID
picks up
Tracking ID
Moni toring
data*
IMS
Log record
moni tors
SOAP Gateway sends the tracking ID with the request to IMS Connect, which makes the ID
visible through the event exit. The id is also recorded into IMS log record as it is placed in
OTMA prefix user data section. On response, the data in OTMA user data section is echoed
back out. IMS Connect returns the tracking id on response back to SOAP Gateway. The
inbound and outbound tracking id is logged if the transaction log feature is enabled.
Tracking transactions from SOAP Gateway to IMS and back using logs
Now that we saw how the tracking propagated from the request to response, we can view
some logs to see how the logs have propagated lets start as seen in Figure 5-10 with the
SOAP Gateway Log first
179
8174ch04.fm
In the ICON BPE TRACE you find the following entries if:
ICONTR <-Message received from a TCP/IP client
ICONIS <-Message to be sent to IMS OTMA
ICONIR <-Message received from IMS OTMA
ICONTS <-Message sent to TCP/IP client
In Figure 5-11 you can see the ICONTR Entry of a BPE trace showing the trace and tracking
ID.
180
8174ch04.fm
In the IMS input output logrecord you see an increase of x34 bytes which means the ICON
User Data in the type01 type03 record has been increased from the usual x'100' bytes to
x'134' bytes where the new/extra x'34' bytes is the *TRCKID* section
Transaction logging
SOAP Gateway creates and versions the transaction log.
The SOAP Gateway transaction log records information about every request made to a web
service provider and the associated response messages from IMS.
With the commands shown in Example 5-8, you can configure SOAP Gateway to enable or
disable transaction file logging, as well as configuring the file properties.
Example 5-8 Configure and enabling transaction file logging
fileNamePrefix
181
8174ch04.fm
182
8174ch04.fm
Transaction Log
Each transaction record uses approximately 300 bytes of disk space, and each successful
transaction generates five transaction records in the active log file
the SOAP Gateway transaction logger creates a record for every incoming request and
outgoing response message that passes through the SOAP Gateway server
183
8174ch04.fm
It eases the setup of synchronous callout for SOAP Gateway and reduce errors that may
occur in a manually created COBOL copy book needed for callout. See Figure 5-13 depicting
an overview of the flow.
1. Identify the WSDL service, port, and operation(s) that your IMS application needs to
invoke.
2. Create top-down Batch Processor options files (e.g., ServiceSpecification.xml) citing the
WSDL service, port, [and a subset of the operations if so desired].
3. 3. Run the Batch Processor once to generate the following for all (or a subset of)
operations:
COBOL Copybook containing 01-level structures for each input or output message.
COBOL XML converter for each operation.
SOAP Gateway correlator containing information for each operation.
Mapping session file for each input or output message
The solution highlights are, we create artifacts needed for synchronous callout from a single
WSDL file, multiple operations are supported for callout. Converters are generated for each
operation defined in WSDL and data types in XSD are associated accordingly to COBOL data
type. The correlator is populated with multiple operations if needed and multiple connection
bundle support is built into RDz 8.5.1.
In Figure 5-14 you see the operational specs you need to specify like serviceName, port, and
other attributes in the ServiceSpecification.xml file
184
8174ch04.fm
Define ServiceSpecification.xml
Output will be generated in the correlator, converter and copybook by using the xsebatch as
shown in Example 5-9.
Example 5-9 xsebatch you need
185
8174ch04.fm
This parameter specifies the fully qualified path of the workspace to be used for the
import. If this path is not specified on the command line then the default is taken from the
environment variable workspace. If that environment variable is not set then the default is
set to the following:
$eclipse_root/workspace
%eclipse_root%\workspace
-e WS_installdir:
This parameter specifies is the Eclipse subdirectory of the directory in which IBM Rational
Developer for System z is installed. If not specified, the default is taken from an
environment variable eclipse_root. If that environment variable is not set then the default is
set to the default installation directory for IBM Rational Developer for System z. That
directory is recorded during installation by the install process and is set in the environment
variable
WDZ71INSTDIR.
-verbose:
This parameter causes the diagnostic messages to be printed to the console.
-version:
This parameter causes the version, release, and modification information to be printed to
the console.
-novalidation:
This parameter turns off the validation of generation property files against an XML
Schema.
-overwrite=yes|no:
If set to yes then this parameter causes newly generated files to overwrite existing files of
the same
Compile and link IMS Connect XML converters
SFEKLOAD data set required for compiling
Setup ICON proc with FEK.SFEKLOAD for STEPLIB.
186
8174ch04.fm
SOAP Gateways
Hello.xml
Hello.wsdl
cb_host_ims1
cb_host_imsa
IMS1
HWS1
Resume
Tpipes
Super
Member
IMSA
Hello.xml
Hello.wsdl
cb_host_ims1
cb_host_imsa
What we need to do to get this to run, is to create a descriptor in DFSYTDx member for
TMEMBER and XML Adapter, as shown in Example 5-10.
Example 5-10 DFSYTDx sample
D HELLO1
D HELLO1
Than we need to Compile and link a single converter. Next we need to do is to Create 2
connection bundles as Example 5-11 shows, by using the SOAP Gateway Management
Utility.
Example 5-11 connection bundles
187
8174ch04.fm
Now we should be able to run the service, but what to do or look for in case we get into a
problem because we did something wrong
We may start with the IMS job log to verify DFSYDTx data set is loaded upon IMS restart
READ SUCCESSFUL FOR DDNAME PROCLIB
MEMBER = DFSYDTx
We Verify MPP job log for ICAL if it has a return and reason codes of 0
If the external web service is not available SOAP log will have the message:
IOGS0077E:
AN ERROR OCCURRED DURING THE INVOCATION OF THE EXTERNAL WEB SERVICE: THE
SERVICE CANNOT BE FOUND FOR THE ENDPOINT REFERENCE
If the external web service times out the SOAP log will have the message:
IOGS0077E:
AN ERROR OCCURRED DURING THE INVOCATION OF THE EXTERNAL WEB SERVICE: READ TIMED
OUT
In that case you should increase the Callout WS timeout value in the callout correlator. You
may have to also increase the timeout value for ICAL in the IMS Application.
A no tpipes specified case will give you a warning
IOGX0019W
skipping the callout connection bundle
If the Connection Bundle is missing that gives you a
IOGX0008W:
The correlator file entries cannot processed
188
8174ch04.fm
Design Overview
189
8174ch04.fm
The exchange of user identity and security attributes information between communicating
parties at the SOAP message level.
The exchange of authentication and authorization assertions across web service
transactions.
WS-Security SAML confirmation method is supported for synchronous callout applications by
extracting the user ID (the user that initiates the synchronous callout application) from the
correlation token and passing it to the external web service.
SOAP Gateway also supports custom authentication modules for accessing the security
header for validation before the SOAP request messages are sent out to the external web
service server.
Like always we have some restrictions to consider, these are:
Only support WS-Security for Synchronous callout
Only support for SAML1.1 or SAML2.0 unsigned assertion
Use different TPIPEs for security and non-security connections
If you use RDz 8.0.3.2 generated correlator files
Then you need to run migration tool first to update correlator files to the latest schema
Keystores/truststores for both provider and callout
Cannot co-exist in the same SOAP Gateway instance
All operations in a service must be the same security type
A few words on how to configure client authentication between SOAP Gateway (client) and
external web services server
Use Java key tool command to create key store, trust store for both client and server,
exchange certificate, import the other side certificate to trust store. e.g. Importing client side
certificate to server side trust store.
Use management utility tool, (Example 5-14) to update client side (SOAP Gateway) keystore,
truststore and passwords information to the connection bundle file.
Example 5-14 update client side
190
8174ch04.fm
iogmgmt prop u l 5
Error scenarios and possible causes you can see in Figure 5-17 and Figure 5-18 on
page 191.
CWWSS6521E: The Login failed because of an exception:
javax.security.auth.login.LoginException:
unable to find valid certification path to requested target
Usually, the policyset is configured to require the token type; the received message does not
have the token in it or it could be that you have SAML20Token configured, but SAML20Token
is not being sent, instead you received SAML11Token.
191
8174ch04.fm
192
8174ch04.fm
You can enable the send-only with acknowledgement protocol for a web service consumer
application with the SOAP Gateway management utility when you create or update a
correlator. Set the value for the -k property to true. The send-only with acknowledgement
protocol is configured at the operation level and can be enabled or disabled without restarting
the SOAP Gateway server.
193
8174ch04.fm
The advantage of using asynchronous callout is that it does not hold up the region, but it does
require the IMS application to be designed in a way that is able to handle the output from the
external application (if any) in a different IMS application instance.
194
8174ch04.fm
When IMS SOAP Gateway receives the response message, it first extracts the response
payload data from the SOAP message. Then, an IMS Connect message is built to send the
response message back to the IMS Appl2. The IMS Connect message has the format,
LLLLIRM<Response data>. The IRM contains the transaction code for the IMS Appl2. It also
contains the XML Adapter name and the converter name if the user chooses to use the XML
adapter function to transform the callout response message. The transaction code, XML
adapter, and converter name are all obtained from the correlator file specified by the user
during the deployment step. If the user chooses not to use the XML adapter, IMS SOAP
Gateway adds LL ZZ and trancode in front of the response data.
After the response message is built, it is sent to IMS Connect using Commit Mode 0 with
Send Only protocol.
When IMS Connect receives the XML response message from the IMS SOAP Gateway, the
XML conversion function converts the XML response data into the IMS application data
format if the user chooses the XML adapter function. Upon receiving the converted
application data bytes from the converter, the XML Adapter computes the new LL value. It
also sets the transaction code value (obtained from the IRM that IMS SOAP Gateway sends)
within the message. The resulting response data message is then sent to IMS Appl2.
Note: If the callout response needs to go back to the initial client, a synchronous callout
solution is recommended. However, a pseudo synchronous solution can be achieved with
appropriate application design, for example, the initial IMS application can wait in the
dependent region and continue to check for the output data (updated by a second
transaction) through a database.
195
8174ch04.fm
Figure 5-20 SOAP Callout to a one-way Web Service invocation with no response
The stages that are associated with this type of asynchronous callout flow are:
1. A client starts IMS Appl1.
2. A one-way callout message is inserted into the ALTPCB by the IMS application App1
using the destination routing descriptor DESTSG1. The descriptor contains the
TMEMBER name, TPIPE name, XML Adapter name, and the associated Converter name.
As part of the destination routing descriptor processing, OTMA reads the descriptor
DESTSG1, which contains a TPIPE name of SGTP1, and sends the callout message to
the asynchronous hold queue SGTP1 TPIPE. The adapter name (HWSXMLA0) and
converter name (XMLCNV1D) specified in the DESTSG1 descriptor are copied to the
OTMA headers of the callout message. The callout message looks like Figure 5-21, after
descriptor processing.
3. IMS SOAP Gateway establishes a sharable persistent TCP/IP connection with IMS
Connect and sends a RESUME TPIPE using an option of No Auto to retrieve messages
from the SGTP1 TPIPE. The TPIPE is obtained from the connection bundle file when IMS
SOAP Gateway starts up.
4. IMS Connect retrieves the existing callout message from SGTP1 as part of the RESUME
TPIPE request processing for IMS SOAP Gateway. It reads the OTMA headers for the
196
8174ch04.fm
adapter name and converter name. It calls the adapter HWSXMLA0 and passes the
converter name XMLCNV1D to it.
After the activity completes the XML Adapter calls the converter XMLCNV1D to perform
the data transformation from COBOL application data to XML. The converter adds the
service data prefix to the message so that IMS SOAP Gateway can use/read the
appropriate correlator file and direct the request to the appropriate Web Service operation.
5. After the converter converts the callout message successfully, XML Adapter wraps the
callout message in a <XMLAdapterOutput> tag and then IMS Connect adds a 4-byte
length LLLL at the beginning of the message and sends the callout request message back
to IMS SOAP Gateway. The resulting callout message appears in Figure 5-22.
6. After IMS SOAP Gateway receives the callout request message, it reads the LLLL portion
of the message and determines the length of the message to be read. It also parses the
message to retrieve the WSID from the service data prefix. Based on the WSID value
WS1, it loads the corresponding correlator file, which is WS1.xml, and retrieves the Web
Service information and properties for invoking the Web Service. The request message for
Web Service is built.
7. After the callout message is processed successfully and the request message for the Web
Service is built, IMS SOAP Gateway internally sends a positive acknowledgement (ACK)
to IMS Connect such that the callout message can be removed from the corresponding
TPIPE.
8. IMS SOAP Gateway sends the one-way callout request message to the Web Service
using SOAP/HTTP. The callout message using SOAP/HTTP appears in Figure 5-23.
.
197
8174ch04.fm
Figure 5-24 SOAP Callout to a one-way Web Service invocation with a response
198
8174ch04.fm
6. After IMS SOAP Gateway receives the callout request message, it reads the LLLL portion
of the message and determines the length of the message to be read. It also parses the
message to retrieve the service data. Based on the WSID value WS1 from the service
data, it loads the corresponding correlator file, which is WS1.xml, and retrieves the Web
Service information and properties for invoking the Web Service. The request message for
Web Service is built.
7. After the callout message is processed successfully and the request message for the Web
Service is built, IMS SOAP Gateway internally sends a positive acknowledgement (ACK)
to IMS Connect such that the callout message can be removed from the corresponding
TPIPE.
8. IMS SOAP Gateway sends the one-way callout request message to the Web Service 1
using SOAP/HTTP. No response is expected from the Web Service 1. The callout
message using SOAP/HTTP appears as in Figure 5-23 on page 197.
9. Web Service 1 executes, generates output, and calls Web Service 2. It is the responsibility
of Web Service 1 to create and transform output in such a manner that it maps to the input
request of Web Service 2.
10.IMS SOAP Gateway receives the Web Service 2 request and it loads the correlator 2
(WS2.xml) to obtain the information for IMS Appl2 and sends the data to IMS Connect. In
this scenario, the IMS transaction code is supplied by the Web Service 2.
11.IMS Connect receives the input message and loads converter 2 (XMLCNV2D) for XML to
bytes conversion. Then, it invokes the IMS application Appl2 to process the data.
199
8174ch04.fm
Figure 5-25 Message flow of SOAP Callout to a request-response Web Service invocation
200
8174ch04.fm
LLLL at the beginning of the message and sends the callout request message back to IMS
SOAP Gateway. The resulting callout message appears as in Figure 5-22 on page 197.
6. After IMS SOAP Gateway receives the callout request message, it reads the LLLL portion
of the message and determines the length of the message to be read. It also parses the
message to retrieve the service data prefix. Based on the WSID value WS1 from the
service data prefix, it loads the corresponding correlator file, which is WS1.xml, and
retrieves the Web Service information and properties for invoking the Web Service. The
request message for Web Service is built.
7. After the callout message is processed successfully and the request message for the Web
Service is built, IMS SOAP Gateway internally sends a positive acknowledgement (ACK)
to IMS Connect such that the callout message can be removed from the corresponding
TPIPE.
8. IMS SOAP Gateway sends the request to the Web Service 1 using SOAP/HTTP and waits
for the response synchronously on the same HTTP connection. The callout message
using SOAP/HTTP appears as in Figure 5-23 on page 197.
9. The Web Service 1 runs and generates output response and sends back to IMS SOAP
Gateway.
10.IMS SOAP Gateway adds the transaction code App2, the adapter name, HWSXMLA0;
and the converter name, XMLCNV2D (all retrieved from the correlator file in step 6) to the
IRM and sends the response message to IMS Connect.
11.IMS Connect receives the response message and loads the response converter
XMLCNV2D for XML to bytes conversion. IMS Connect takes the transaction code value
and adds it to the appropriate place (LLZZTRCDDATA) in the message.
12.IMS invokes the IMS application App2 to process the output data.
RDz can be used to import the SOAP Client WSDL, generate the correlator file, create the
XML Converter routine to be called by IMS Connect to do the XML transformation for the
callout message, and the COBOL copy member that represents the output message.
201
8174ch04.fm
202
8174ch04.fm
203
8174ch04.fm
204
8174ch04.fm
205
8174ch04.fm
206
8174ch04.fm
207
8174ch04.fm
208
Feature
Minimum SOAP
Gateway
version
Minimum IMS
version
Minimum IMS
Connect version
Minimum
Rational Tooling
version
Accessibility
Enablement
v 9.2
v9
v9
7.0
IMS Connect
XML Adapter
Support
v9.2
v9
v9
7.0
Security
Enhancements:
SSL/HTTPS
v 9.2
v9
v9
7.0
Platform Support:
z/OS and zLinux
zLinux: v9.2
z/OS: v10
v9
v10
v9
v10
v7.0
v7.1.1
Asynchronous
Callout
v10.1
v10
v10
7.1.1
8174ch04.fm
Feature
Minimum SOAP
Gateway
version
Minimum IMS
version
Minimum IMS
Connect version
Minimum
Rational Tooling
version
Synchronous
Callout
v10.1 +iFIX2
v10
v10
7.1.1.3
Multiple Segment
v10.2
v10
v10
v 7.5
Refer to the following Web site for the current SOAP Gateway compatibility table:
http://www-01.ibm.com/support/docview.wss?uid=swg27036162
Multiple segment support in IMS SOAP Gateway is announced in the IMS Version 11 QPP
(Quality Partnership Program) announcement number 208-258 found in URL:
http://www.ibm.com/common/ssi/index.wss?DocURL=http://www.ibm.com/common/ssi/rep_c
a/8/897/ENUS208-258/index.html&InfoType=AN&InfoSubType=CA&InfoDesc=Announcement+Le
tters&panelurl=index.wss%3Fbuttonpressed%3DNAV002PT090&paneltext=Announcement+lett
er+search
This concludes our discussion about SOAP Gateway.
209
8174ch04.fm
210
8174ch05.fm
Chapter 6.
211
8174ch05.fm
212
8174ch05.fm
For additional information about Java EE, see the official specification:
Java EE 5: JSR 244: Java Platform, Enterprise Edition 5 (Java EE 5) Specification
Java EE 6: JSR 316: JavaTM Platform, Enterprise Edition 6 (Java EE 6) Specification
Java EE 7 JSR 342: JavaTM Platform, Enterprise Edition 7 (Java EE 7) Specification
A history of the mentioned Java Versions:
Java EE 5 (May 11, 2006)
Java EE 6 (Dec 10, 2009)
Java EE 7 (May 28, 2013
Here are some Java EE 7 Platform Highlights.The most important goal of the Java EE 7
platform is to simplify development by providing a common foundation for the various kinds of
components in the Java EE platform. Developers benefit from productivity improvements with
more annotations and less XML configuration, more Plain Old Java Objects (POJOs), and
simplified packaging. The Java EE 7 platform includes the following new features:
If you are a beginner with Java you would like to start with JUNO Eclipse Version The JDT
project provides the tool plug-ins that implement a Java IDE supporting the development of
any Java application, including Eclipse plug-ins. It adds a Java project nature and Java
perspective to the Eclipse Workbench as well as a number of views, editors, wizards,
builders, and code merging and refactoring tools. The JDT project allows Eclipse to be a
development environment for itself.
213
8174ch05.fm
inbound message and the outbound message, and vice versa.This application development
approaches are solved or imbedded into the rational development products or better in the
Eclipse IDE
After you have installed the Eclipse Workbench IDE you may start with the first Java projects
HelloWorld and HelloWorld SWT to find the distingtion between SWT and non SWT see
Figure 6-1. In the IDE you also find the Cheat sheets very useful.
Java Editor
The Java Editor example Figure 6-2 on page 215demonstrates the standard features
available for custom text editors. It also shows how to register an editor for a file extension (in
this case .jav) and how to define a custom Document provider for use by that editor. This
example is only for demonstration purposes. Java editing support is provided by the Eclipse
Java Tooling.
214
8174ch05.fm
In the Help section tryout the cheat sheets as you see in Figure 6-3.
215
8174ch05.fm
Ok so far for the basics of Java Application development it can only be a short introduction
and overview since the topic would fill to many books. lets see what is in from the IMS side.
}
Remote system
The mainframe system component is also referred to as the remote system component. It is
the part of the product that is installed on the System z mainframe. The remote system
component is the System z mainframe to which you connect to access your data. This portion
of the product is installed into a z/OS logical partition (LPAR) by the site system programmer.
The remote system component provides the interface between the workstation client and
traditional development components, such as JES and the file system.
During setup, you create a connection between the workstation client and remote system
components. The remote system component provides transaction management system
functions to communicate with IMS and CICS. Problem determination tools, such as the IBM
Debug Tool are included.
Workstation client
The workstation client is the portion that is installed on a personal computer operating
environment. It must be installed on each developer's computer. Throughout the product
documentation, the term IBM Rational Developer for System z refers to the workstation
component. The client software can be installed on a Microsoft Windows operating system or
a Linux operating system. The two components communicate by using TCP/IP.
216
8174ch05.fm
The user interface contains a set of development tools that support the development,
maintenance, and web service enablement of enterprise applications.
Access z/OS assets.
You can organize, allocate, manage, and edit z/OS data sets and tools.
Develop, maintain, compile, and assemble source files by using integrated
language-sensitive editors for
COBOL, PL/I, IBM High Level Assembler (HLASM), C/C++, Java, job control language
(JCL), basic mapping support (BMS), and Message Format Service (MFS).
You can access source directly from MVS data sets or through a number of source
control management (SCM) systems.
Manage and edit data, such as
Queued sequential access method (QSAM) or sequential data sets
Virtual Storage Access Method (VSAM) or indexed data sets
Relative and entry sequenced data sets
DB2 tables and views
Information Management System (IMS) databases
Access to your z/OS Job Entry Subsystem (JES) to submit
jobs and JES spool files to organize and manage batch jobs.
Access other tools such as wizards and declarative development tools that replace low-level
coding to create, deploy and test DB2 stored procedures, web services, and Service
Component Architecture (SCA); transform Unified Modeling Language (UML) models to
COBOL; and use Enterprise Generation Language (EGL) to develop web 2.0 and Java 2
Platform and Enterprise Edition (J2EE) applications.
217
8174ch05.fm
When you use these snippets in conjunction with the System z LPEX Editor or COBOL Editor,
references to nested fields of the AIB or PCB control blocks in the snippet code are replaced
automatically with the actual fields present in the referenced AIB or control block. For
example, when generating the line of code MOVE LENGTH OF AIB TO AIBRLEN OF AIB, the
snippet generator looks up the field defined at offset 8 of the AIB control block selected in the
dialog and uses that as the name for the AIBRLEN field. If the AIB block cannot be parsed out
of the code, a default value for the field is used.
When generating the DL/I call, the snippet code generator tries to look up a level 77 field
whose VALUE clause equals the DL/I function and use that in the call. For example, when
creating the code for the GHN snippet, the generator parses the code and may find the
declaration in Example 6-1.
Example 6-1 GET-HOLD-NEXT snippet
77
GET-HOLD-NEXT
PICTURE X(4)
At that point, GET-HOLD-NEXT is substituted into the function call. If no match is found, the
snippet name (GHN in this case) is used in the function call.
These snippets add the DL/I function names as level 77 data structures.
218
8174ch05.fm
As shown in the above figure, protocol-level logic exists in code-complete procedures named
OperationNameHandler that are dedicated to handling interactions with the IMS Message
Queue and IRZPWSIO APIs on behalf of the respective user-written business logic in
procedures named OperationNameImpl. All of the user-written business logic must be
entered into the OperationNameImpl procedures. At execution time, OperationNameImpl
procedures are invoked by their respective OperationNameHandler procedure.
Appendix A.9, Enhanced Provider MPP template sample on page 437 shows an example of
an enhanced template for a WSDL file that includes three operations:
getteam_1_0
setteam_1_0
ping_1_0
The operations getteam_1_0 and setteam_1_0 may issue a SOAP fault.
219
8174ch05.fm
In addition, the IMS TM Resource Adapter implements the J2C Common Client Interface
(CCI), which is a programming interface that allows your application to communicate with the
IMS Transaction Manager.
The IMS TM Resource Adapter is used with a Java EE server, such as IBM WebSphere
Application Server, when Java applications (Java EE artifacts in the WebSphere Application
Server) access an IMS transaction that is running on a host IMS system. The IMS TM
Resource Adapter also enables an IMS application to act as a client to invoke applications in
a Java EE server.
220
8174ch05.fm
Supported platforms
The IMS TMRA runtime component supports WebSphere Application Server on the following
platforms:
AIX
HP-UX
Linux
Linux for System z
Solaris
Windows
z/OS and OS/390
221
8174ch05.fm
Connect during system maintenance without resubmitting any IMS TM Resource Adapter
interactions from the client application.
IMS MFS SOA support
IMS MFS SOA support is integrated with the Enterprise Metadata Discovery (EMD)
framework in Rational Application Developer Version 7.5 or later to transform existing
MFS-based IMS applications into J2C Java beans and J2C Java Data Binding classes.
After you create a J2C Java bean, you can create Java EE artifacts, such as JSPs, EJBs,
or Web Services, to deploy the generated J2C Java bean.
IMS MFS SOA support is supported in the following WebSphere Application Server V6.1
runtime environments:
Windows
z/OS
Rerouting undeliverable output messages to a specified destination for commit mode 0,
SYNC_SEND interactions on sharable persistent sockets
The reroute function allows undeliverable output messages to be rerouted to a specified
destination. Previously, the reroute function was supported for only commit mode 0 (CM0),
SYNC_SEND_RECEIVE interactions on sharable persistent sockets. This enhancement
supports the reroute function on CM0, SYNC_SEND interactions on sharable persistent
sockets.
222
8174ch05.fm
223
8174ch05.fm
Message Format Services (MFS) Business Process Execution Language (BPEL) support
MFS BPEL support for the WebSphere Integration Developer assists integration
developers with business-to-business transformation. This support creates Web
Services/EJB/JSPs out of existing MFS-based IMS applications, and provides support for
Service Component Architecture (SCA), Enterprise Metadata Discovery (EMD) 1.1, and
BPEL. It includes a GUI wizard that allows you to parse the MFS source files and generate
the service definition and artifacts. The generated application can be deployed to run on
WebSphere Process Server for business orchestration and choreography.
Synchronous Callout support
Synchronous callout (also available through an IMS Version 10 SPE) for IMS TMRA
manages the correlation of a callout request. This enables IMS applications to invoke
external applications and synchronously receive a response in the same IMS transaction
instance. External applications and servers include Java EE applications (EJB/MDB).
Support for multiple data stores per IMS activation specification for
callout messages
This enhancement enables a single message-driven bean (MDB) to pull callout messages
from more than one IMS data store. For a shared-queues environment, this enhancement
removes the requirement to duplicate the MDB application to connect to each IMS member in
the shared queue.
224
8174ch05.fm
You must configure an instance of the IMSActivationSpec object when you deploy a
message-drive bean in order for the IMS TM resource adapter to communicate with IMS
Connect for retrieving and responding to synchronous callout messages.
The following Table 6-1 describes the properties for the IMSActivationSpec object, the
implementation of the J2C activation specification in IMS TM resource adapter. The values for
these properties are to be specified and configured by using the administrative console in
WebSphere Application Server.
Table 6-1 Properties for the IMSActivationSpec object
Properties
Description
dataStoreName
IMS data store name. The name must match the ID parameter of the Datastore statement
that is specified in the IMS Connect configuration member when IMS Connect is installed. It
also serves as the XCF member name for IMS during cross-system coupling facility (XCF)
communications between IMS Connect and OTMA.
With Version 12 and later, the data store name can be a comma-separated list of data store
names, enabling one instance of the IMSActivationSpec class to pull callout messages from
more than one IMS data store.
groupName
hostName
password
SAF password
portNumber
queueNames
A comma-delimited list of IMS OTMA tpipe names for the callout (synchronous or
asynchronous) messages. Queue names must be 1 to 8 alphanumeric characters (A-Z, 0-9,
@, #, $).
retryInterval
The time delay in milliseconds before the IMS TM resource adapter tries to check on the
availability of the data store.
retryLimit
The maximum number of times the IMS TM resource adapter will attempt to reconnect to IMS
Connect if a connection is lost due to IMS Connect or IMS data store availability issues.
For Version 10.5.1, Version 11.3.1, and Version 12 and later, when the retryLimit value is set
to -1, the IMS TM resource adapter will retry indefinitely to reconnect to IMS Connect if the
backend IMS Connect or IMS data store is restarted.
SSLEnabled
Instructs the IMS TM resource adapter to create a Secure Sockets Layer (SSL) socket
connection to IMS Connect by using the specified host name and port number in the
IMSActivationSpec object. This property is valid for TCP/IP connections only.
SSLEncryptionType
Specifies the SSL encryption type. Valid values are strong and week.
SSLKeyStoreName
The name, including the full file path, of the keystore for TCP/IP SSL communications.
Private keys and their associated public key certificates are stored in password-protected
databases called keystores. Trusted certificates can also be stored in the keystore, and the
truststore property can either be empty or could point to the keystore file. An example of a
keystore name is c:\keystore\MyKeystore.ks. The file can have other file extensions.
SSLKeyStorePassword
SSLTrustStoreName
The name, including the full path, of the keystore file that contains security credentials
(certificates) for TCP/IP SSL communications. A value for the SSLTrustStoreName property
is not mandatory if a keystore is used. A truststore file is a key database file that contains
public keys or certificates. Private keys can also be stored in the truststore, and the keystore
property can either be empty or could point to the truststore file. An example of a truststore
name is c:\keystore\MyTruststore.ks. The file can have other file extensions.
SSLTrustStorePassword
225
8174ch05.fm
Properties
Description
userName
Properties in the J2C activation specification that are not listed in the Table 6-1 are not
supported by the IMS TM resource adapter.
8174ch05.fm
For commit mode 0 interactions, when it receives the output message, the IMS TM resource
adapter sends an ACK message to IMS, which signals IMS to discard the output from the IMS
queue. When the client application closes the connection or terminates, the connection is
returned to the connection pool for reuse by other commit mode 0 or commit mode 1
interactions.
227
8174ch05.fm
The undelivered output message can be rerouted to a specific destination as described in the
error processing scenario.
When the client application closes the connection or terminates, the connection is returned to
the connection pool so it can be reused by other commit mode 0 or commit mode 1
interactions.
228
8174ch05.fm
Important steps you need to consider if installing the TM Resource Adapter are:
1. If you are installing the IMS TM resource adapter archive (RAR) on a generic application
server, additional class libraries might be needed for use with the IMS TM resource
adapter. For class libraries that are not included in the IMS TM resource adapter
installation archive, contact your product representative for the development environment
of your choice for information regarding the licensing and location of any needed JAR files.
2. When you use the Install RAR dialog to install a RAR file, the scope you define on the
Resource Adapters page has no effect on where the RAR file is installed. You can install
RAR files only at the node level, which you specify on the Install RAR page. To set the
scope of an RAR file to a specific cluster, or server, after you install the RAR file at each
node level, create a copy of the RAR file with the appropriate cluster or server scope
You must have installed the IMS TM resource adapter RAR to a file system that is accessible
to your WebSphere Application Server.
229
8174ch05.fm
Start the WebSphere Application Server and log in to the administrative console to deploy the
RAR on a WebSphere Application Server:
1. In the navigation pane in the administrative console (also known as the Integrated
Solutions Console), click Resources > Resource Adapters > Resource adapters.
2. If a RAR that you no longer want to use is already installed, delete it first. Stop and restart
the WebSphere Application Server. Repeat the previous step to return to the resource
adapter configuration page.
3. In the content pane, click Install RAR. You might need to scroll down in the pane to locate
the button. The Install RAR File page displays.
4. Click Local file system or Remote file system, depending on the location of the RAR file.
5. If you choose Local file system, click Browser to locate and specify the IMS TM resource
adapter RAR file that is installed, for example,
install_path/IBM/IMS/ICOxx/Vxxxx/JCA15/imsxxxx.rar.
6. Click Next.
7. On the Configuration page, type a name for the RAR, for example, imstmravxxxx. Click
OK.
8. Optionally, create a copy of the RAR file with a different scope level. After you install the
RAR file at each node level, you can create another copy of the file that has a specific
server or cluster as the scope for that file. See the Installing a resource adapter archive
topic in WebSphere Application Server information center.
9. To save your results in the master configuration, click Save at the top of the panel.
8174ch05.fm
simple and most frequently used. Conversational transactional flow is also supported, but
does not always fit well in SOA scenarios.
When a Java application submits a transaction request to IMS through IMS TMRA, IMS
Connect sends the transaction request to OTMA by using cross-system coupling facility
(XCF) communications, and the transaction runs in an IMS dependent region. The response
is returned to the Java application using the same path.
If access is engaged through a deployed TM Resource Adapter in the WebSphere Application
Server Java EE container, the Common Client Interface (CCI) contract is honored. Figure 6-9
on page 231 shows the container component contract with respect to the other components
within the container.
231
8174ch05.fm
Define the factory with the WebSphere Application Server Administration Console, and
label it with a JNDIName for look-up.
Note: The factory can also be instantiated at runtime if no container (WebSphere
Application Server) is available, which is also true for Java Batch, stand alone
programs.
In that case, the factory must be instantiated at runtime.
ConnectionSpec
This object provides some additional connection properties for the connection, mainly
related to security and identification. See Figure 6-11 on page 233 for details.
Interaction
This object is the coordinator of the interaction executed with IMS. Its execute method
triggers the interaction.
InteractionSpec
This object specifies the details of the interaction. See Figure 6-11 on page 233 for details.
232
8174ch05.fm
The InteractionVerb is probably the most important parameter, which indicates what action
IMS Connect must take. We remind you that the TM Resource client is always the contacting
partner, even if IMS must send output.
The available verbs are:
SYNC_SEND (value 0)
Sends a request to IMS when a response is not expected, in another words, perform a
send only interaction.
SYNC_SEND_RECEIVE (value 1)
Used for the single iteration of a non-conversational IMS transaction and for each iteration
of a conversational IMS transaction.
Note: SYNC_RECEIVE (value 2) is currently not supported by IMS Connector for Java.
SYNC_END_CONVERSATION (value 3)
Forces the end of an IMS conversational transaction.
SYNC_RECEIVE_ASYNCOUTPUT (value 4)
Retrieves asynchronous output messages. With this type of interaction, the Java client can
only receive a single message. If there are no messages in the IMS OTMA Asynchronous
Queue for the clientID when the request is made, no further attempts are made to retrieve
the message. No message is returned and a time-out occurs after the length of time
specified in the executionTimeout property of the SYNC_RECEIVE_ASYNCOUTPUT
interaction.
Chapter 6. JEE application technology
233
8174ch05.fm
SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT (value 5)
Retrieves asynchronous output messages. With this type of interaction, the Java client can
only receive a single message. If there are no messages in the IMS OTMA Asynchronous
Queue for the clientID when the request is made, no further attempts are made to retrieve
the message. No message is returned and a time-out occurs after the length of time that is
specified in the executionTimeout property of the
SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT interaction.
SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT (value 6)
Retrieves asynchronous output messages. With this type of interaction, the Java client can
only receive a single message. If there are no messages in the IMS OTMA Asynchronous
Queue for the clientID when the request is made, IMS Connect waits for OTMA to return a
message. IMS Connect waits the length of time specified in the executionTimeout property
of the SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT interaction before returning an
exception.
The Generated Client ID function: In IMS Version11, the TM Resource Adapter is
enhanced to take advantage of a new function in IMS Connect: the Generated Client ID
function, which ensures the uniqueness of each socket.
This enhancement eliminates the requirement for IMS TM Resource Adapter to use
different IMS Connect ports for instances of distributed WebSphere Application Server.
IMS Connect can use the Generated Client ID function to ensure the uniqueness of each
socket and allow all instances of WebSphere Application Server to specify the same IMS
Connect TCP/IP port.
234
8174ch05.fm
OTMA destination routing descriptors are used by customers who implement this callout
function or who implement message switches from OTMA to non-OTMA destinations and do
not want to code the OTMA routing exits (DFSYPRX0 and DFSYDRU0). If an OTMA
descriptor is used with the callout function, Destination Routing Descriptors in the DFSYDTx
member of IMS.PROCLIB must be created specifying the appropriate properties for the
callout destination. The properties depend on the type of callout.
We distinguish two types of callout requests:
Asynchronous: The request is sent, but the sending IMS program does not wait for the
response, which is returned as a separate IMS transaction invocation if necessary. This
happens through an ISRT call to an ALTPCB destination.
Synchronous: The sending IMS program waits for the response from the send / receive
call flow. Also a time-out value needs to be provided. The request is performed through the
new ICAL call function to an alternate destination, which is described through an OTMA
descriptor.
A new optional keyword SYNTIMER is introduced to the OTMA descriptor so that the user
can specify a time value to wait in hundredths of seconds, which can range from 1 to
900000, for synchronous call process to complete. See Example 6-2.
Example 6-2 OTMA descriptor keyword SYNTIMER
235
8174ch05.fm
Any two instances of the same stateless session EJB type are always identical, and
each instance can be shared by multiple clients.
For more information about this subject refer to the WebSphere InfoCenter at URL:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.
websphere.base.doc/info/welcome_base.html
Message Driven Bean (MDB)
Message-driven beans (MDBs) are stateless, server-side Java EE components for
processing asynchronous messages. A MDB bean is an asynchronous bean activated by
message deliveries and can consume and process messages concurrently.
A MDB can be used as a listener to receive callout requests that are retrieved by IMS
TMRA. Then the MDB can route the message to the appropriate EJB or other application
within the WebSphere Application Server for further processing.
8174ch05.fm
In the WebSphere Application Server, the listening Java (EJB) code can be a Stateless
Session Bean (SLSB) or the listener of a Message Driven Bean (MDB).
Figure 6-13 Message flow of Asynchronous Callout to SLSB using IMS TM Resource Adapter
The message flow of asynchronous callout to SLSB using the IMS TM Resource Adapter is:
237
8174ch05.fm
1. In preparation for the flow, the EJB application in a WebSphere Application Server starts
and obtains a shareable persistent connection to IMS Connect through the IMS TM
Resource Adapter. It issues a SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT
interaction, specifying the tpipe name as the value for the alternate client ID, and sets a
large time-out value. TMRA in turn issues a RESUME TPIPE request to the tpipe and
waits for the callout request from IMS Connect.
2. An initiating client, such as a terminal or an IMS Connect or OTMA client, causes an IMS
application to start.
3. The IMS application issues an ISRT ALTPCB call to an OTMA destination routing
descriptor, which contains the destination tpipe name. The callout request message is
queued on this tpipe.
4. As soon as the callout request is available in the tpipe, IMS Connect delivers the callout
message to TMRA.
5. TMRA receives the callout request message and presents the callout request to the EJB.
6. The EJB processes the callout request.
7. If the EJB has response data to be sent back to IMS, the EJB issues a normal IMS
send_only transaction request through IMS TMRA and IMS Connect to IMS.
8. A second IMS application is scheduled to handle the asynchronous reply.
To prepare a Java application for inbound requests from an IMS application program, you
must specify the appropriate interaction verb and the asynchronous hold queue name in the
Java application. Also, specify a time-out value.
Specify the asynchronous hold queue name.
InteractionSpec.setAltClientID(calloutQueueName);
Set the interactionVerb property to SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT.
interactionSpec.setInteractionVerb(com.ibm.connector2.ims.ico.
IMSInteractionSpec.SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT);
Specify an execution time-out value (in milliseconds) that you want to wait for a callout
request message in the hold queue.
interactionSpec.setExecutionTimeout(3600000);
In this example, we specify a large execution time-out value. A large execution time-out value
helps to minimize the looping required in a callout EJB when there might be long periods of
time when no callout requests occur.
Sample code related to the asynchronous callout to a SLSB can be found in ICAL
Synchronous Program Switch COBOL program on page 416.
238
8174ch05.fm
239
8174ch05.fm
A new DLI call, the ICAL SENDRECV synchronous call function, allows an IMS application
program to communicate with other external applications synchronously. An IMS Call (ICAL)
sends a synchronous request for data or services from an IMS application program running in
the IMS TM environment to a non-IMS application program or service running in a distributed
environment. ICAL processing does not use the IMS message queue.
Here is the format of this new DLI call:
CALL 'AIBTDLI' USING function, aib,i/o area
The parameters are:
function: set to ICAL
aib
Specifies the application interface block (AIB) to be used for this call.
AIBID
Eyecatcher. This 8-byte field must contain DFSAIBbb.
AIBLEN
240
8174ch05.fm
AIB length. This field must contain the actual length of the AIB that the application
program obtained.
AIBSFUNC
This sub function code field must contain one of the listed 8 byte sub function codes:
SENDRECV. The IMS application program uses this sub function for synchronous
program to program communication.
AIBRSNM1
This resource name field contains the OTMA descriptor name. AIBRSNM1 is an 8 byte
alphanumeric left-justified field padded with blanks.
AIBRSFLD
This 4 byte field is used by the IMS application program to specify a time value to wait
in 100th of a second for the synchronous call process to complete. This value overrides
the value specified in the OTMA descriptor. The minimum value is 0 and the maximum
value is 999999. The system default is 10 seconds.
AIBOALEN
This request area length is an input and an output parameter. As an input parameter
this 4-byte field must contain the length of the input request area that is specified in the
call list. As an output parameter this field is only updated when partial data is returned
(AIB return code x'100', AIB reason code x'00C'). In the case of partial data returned,
this field contains the actual length of the response message. For any return code
other than partial data, this field is unchanged.
i/o area
The ICAL synchronous call function provides the ability for an IMS application program to
communicate with other application programs in a synchronous manner using the new OTMA
message processing function. Because the IMS message queue is not used, the 32K
message segment restriction was removed.
The ICAL synchronous call function is only supported using the AIBTDLI interface in IMS TM
runtime environments for IFP, MPP, BMP, JMP, and JBP regions.
Attention: Coordinated two phase commit between the IMS application program and the
external application program is not supported in the IMS Version 10 SPE. Also a Shared
Queues back-end IMS which is not connected to IMS Connect, cannot issue this ICAL.
The functions that OTMA provides as part of its support for the IMS synchronous callout
Version 10 SPE are:
Flow the synchronous callout request and receive the response
Enhance the OTMA output descriptor
Provide the time-out function for the ICAL call
Provide the OTMA protocol updates so that the synchronous callout request and the
response can be recognized by both IMS Connect and OTMA
Provide a simplified OTMA TPIPE log record to track input and output flow of a
synchronous callout message
Provide the OTMA command updates
OTMA connects the ICAL call to the IMS Connect client applications so that a synchronous
callout request can be delivered to them and the response can be given back to the IMS
application. This synchronous callout request is delivered through the OTMA Resume TPIPE
Chapter 6. JEE application technology
241
8174ch05.fm
method. If the request is larger than 32K, it is delivered to IMS Connect using a multi-segment
flow. The size of each message segment is equal or less than 32K. IMS Connect assembles
the segments and deliver them as one complete message to IMS Connect client applications,
such as IMS TM Resource Adapter.
242
8174ch05.fm
Figure 6-17 Message flow of Synchronous Callout to MDB using IMS TM Resource Adapter
The message flow of a synchronous callout to MDB using IMS TM Resource Adapter is:
1. When the Java EE application that contains the deployed MDB is started in the
WebSphere Application Server through the ActivationSpec and the underlaying listening
software, a sharable persistent connection to IMS Connect is obtained through TMRA. It
issues a SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT interaction, specifying the
tpipe name as the value for the alternate client ID, and sets a large time-out value. TMRA
issues a RESUME TPIPE request to the tpipe and waits for the callout request from IMS
Connect. The addressing information is pulled from properties in the MDB deployment
descriptor.
2. An initiating client, such as a terminal, an IMS Connect, or an OTMA client provokes the
scheduling of an IMS application.
3. The IMS application issues an ICAL call to an OTMA destination routing descriptor, which
contains the destination tpipe name.
4. The callout request message is queued in this tpipe.
5. As soon as the callout request is available in the tpipe, IMS Connect delivers the callout
message to TMRA.
Chapter 6. JEE application technology
243
8174ch05.fm
6. TMRA receives the callout request message and passes the callout request to the MDB in
the onMessage() method.
7. The MDB processes the callout request.
8. Response data are returned as an object of type Javax.resource.cci.Record with the
output data.
9. The waiting IMS App1 is presented the response.
Sample code for the MDB is located in A.5, Synchronous callout to a Message Driven Bean
on page 428.
244
8174ch05.fm
Description
IMSConnection
IMSConnectionFactory
IMSConnectionMetaData
IMSConnectionSpec
IMSDFSMessageException
IMSInteraction
IMSInteractionSpec
An instance of this class contains properties that are used in an interaction with
IMS via IMS Connect.
IMSManagedConnection
IMSManagedConnectionFactory
IMSManagedConnectionMetaData
IMSResourceAdapterMetaData
245
8174ch05.fm
246
8174ch05.fm
Figure 6-18 Supported software configurations by version of the IMS TM resource adapter
247
8174ch05.fm
import
import
import
import
import
248
javax.jms.JMSException;
javax.jms.Queue;
javax.jms.QueueConnection;
javax.jms.QueueRequestor;
javax.jms.QueueSession;
8174ch05.fm
import javax.jms.Session ;
import javax.jms.TextMessage;
import com.ibm.ims.jms.IMSQueueConnectionFactory;
public class IMS_Sample
{
public static void main(String argv[])
{
IMSQueueConnectionFactory jmsConnectionFactory
= new IMSQueueConnectionFactory();
QueueConnection jmsConnection = null;
QueueSession jmsQueueSession = null;
Queue jmsQueue = null;
QueueRequestor jmsQueueRequestor = null;
try {
jmsConnectionFactory.setTimeout(1000);
// set the timeout to 10 seconds
jmsConnectionFactory.setResponseAreaLength(128000);
// allocate 128k to hold the response message
jmsConnection = jmsConnectionFactory.createQueueConnection();
jmsQueueSession
= jmsConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
// set session to be non-transacted and in AUTO_ACKNOWLEDGE mode
jmsQueue = jmsQueueSession.createQueue("OTMDEST1");
// pass in the OTMA descriptor name
jmsQueueRequestor
= new QueueRequestor(jmsQueueSession, jmsQueue);
TextMessage sendMsg = jmsQueueSession.createTextMessage();
sendMsg.setText("MyMessage");
System.out.println("Sending message: "+sendMsg.getText());
TextMessage replyMsg
= (TextMessage)jmsQueueRequestor.request(sendMsg);
System.out.println("\nReceived message: "+replyMsg.getText());
} catch (JMSException e) {
e.printStackTrace();
}
}
249
8174ch05.fm
8174ch05.fm
The Universal DB resource adapters can now leverage the IMS catalog that was released
in IMS V12. This provides a trusted source of database and application metadata. By
providing a central source for metadata we are also improving the ease of scaling
applications as there is no file system dependency for application metadata
Qualify by Position Support
IMS DB has enhanced its SSA qualifications to take an offset and a length for a chunk of
data in a segment instead of a field name. This completely removes the notion of "search"
fields (fields defined directly in the IMS DBD source) as all fields can now be searched.
This removes any IMS specific knowledge in forming SQL qualifications and speeds up
application development and improves tool integration.
Support for scalars
This was added for analytic purposes. Suppose you have a value that is stored as 0 based
but you know it's actually 1 based. You can adjust it using 'SELECT COLUMN + 1 FROM
TABLE' and get it adjusted for you in the query itself instead of having to do application
manipulation of the ResultSet
Enhanced SQL support for OLAP function
We also added support for numeric functions such as SIN, COS, LOG, and EXP. Similar to
above this will help users write queries that produced results they want instead of having
to massage data afterwards in an application. This is very important for reporting and
analytic tools such as Cognos.
WebLogic support
We enhanced our drivers to work with WebLogic. You're able to leverage everything you
get from using the Java EE architecture like connection pooling. More importantly for many
customers, this also provides the capabilities of doing two phase commit
Performance enhancements
We have a lot of performance enhancements to the resource adapters such as better
caching. These same technologies apply to our other Universal Drivers which have been
benchmarked at over 19000 transaction per second in a JMP region.
251
8174ch05.fm
When running locally on the same logical partition (LPAR) as IMS, the IMS Universal drivers
connect to IMS by using a type-2 connection architecture, which supports direct
communication with IMS through the IMS Open Database Access (ODBA) and IMS database
resource adapter (DRA) interfaces.
WebSphere Application Server supports all of the IMS Universal drivers in both distributed
and z/OS environments.
IMS Universal drivers: WebSphere Application Server type-4 connections
Java applications that run on WebSphere Application Server can access IMS databases
by using the type-4 connectivity provided by the IMS Universal drivers. The type-4
connectivity of the IMS Universal drivers enables Java application programs to access IMS
databases from a wide variety of distributed and mainframe environments, either in
stand-alone mode or under an application server, with or without XA support for global
transactions.
IMS Universal drivers: WebSphere Application Server for z/OS type-2 connections
When WebSphere Application Server for z/OS and IMS are on the same logical partition
(LPAR), Java applications running in WebSphere Application Server for z/OS can access
IMS databases by using the type-2 connectivity provided by the IMS Universal Database
resource adapters.
The IMS Universal drivers: CICS connections
Java applications that run on IBM CICS Transaction Server for z/OS can access IMS
databases by using the type-2 connectivity provided by the IMS Universal drivers. Other
than the Java layer, access to IMS from a Java application is the same as for a non-Java
application.
In Table 6-3 you find the comparison where to use the different IMS Universal Database
resource adapters you need. In your z/OS Unix file system on the IMS mount point usually
under usr lpp ims. See Figure 6-19 for details where your mount point might be slightly
different.
252
8174ch05.fm
Transaction
processing required
Recommended approach
WebSphere
Application Server for
distributed platforms or
WebSphere
Application Server for
z/OS
JDBC programming
interface to perform
SQL data operations.
Local transaction
processing only.
JDBC programming
interface to perform
SQL data operations.
Two-phase (XA)
commit processing (1)
or local transaction
processing.
JDBC programming
interface to perform
SQL data operations.
Two-phase (XA)
commit processing (2)
or local transaction
processing.
CCI programming
interface to perform
SQL or DL/I data
operations.
Local transaction
processing only.
CCI programming
interface to perform
SQL or DL/I data
operations.
Two-phase (XA)
commit processing (1)
or local transaction
processing.
Standalone Java
application (outside a
Java EE application
server) that resides on
a distributed platform
or a z/OS platform
Traditional DL/I
programming
semantics to perform
data operations.
Two-phase (XA)
commit processing (2)
or local transaction
processing.
Standalone non-Java
application that
resides on a
distributed platform or
a z/OS platform
Two-phase (XA)
commit processing or
local transaction
processing.
Note:
1. XA transaction support is available only with type-4 connectivity.
2. The driver is enabled for local and XA transactions, but the application programmer is
responsible for implementing the two-phase commit mechanism. XA transaction
support is available only with type-4 connectivity.
We also support Type 2 and Type 4 connection with the Universal DB resource adapters.
Distributed access
253
8174ch05.fm
Universal drivers support type 4 connectivity to IMS databases from TCP/IP enabled
platforms and runtimes
Windows
zLinux
z/OS
WebSphere Application Server
Standalone Java SE
Resource Recovery Services (RRS) is NOT required if applications do not require distributed
two phase commit.
The Universal drivers have a framework capable of processing any of the three main
programming models: J2EE, JDBC, DLI. The Universal drivers are able to connect to any IMS
subsystem on any mainframe system. The same application can have active connections to
any number of IMS systems on any number of mainframe installations.
We are also providing type 2 access (IMS access from the same LPAR in WAS z/OS, IMS
JDR, CICS, DB2 for z /OS stored procedures) using these same Universal drivers. See
Figure 6-20. Again, the same framework is capable of handling both type 2 and type 4
connectivity so the applications themselves do not change. Only the connection properties.
LPAR A
z/OS WAS
IMS
DB
Resource
Distributed
Adapter
Type-2
Universal
DB
Resource
Adapter
1. 5
JDBC
PC CTL
O
D
B
A
PC
LPAR C
TCP/IP
TCP/IP
P
I
CTL
IMS DB
IMS
IMS Connect
T
DLI
IMS DB
IMS
Traditional ODBA
S
C
I
DLI
O
D
B
A
S
C
I
ODBM
JDBC
1.5
ODBM
PC
XCF
O
D S
B C
A I
LPAR B
Traditional ODBA
Univer sal
ODBM
S
C
I
S
C
I
O
D
B
A
PC
CTL
IMS DB
Type-4
For more details and programming info follow this link to the IMS Info Center
http://pic.dhe.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.ims12.d
oc%2Fimshome_v12.htm.
254
8174p02.fm
Part 2
Part
Extended architecture
and application
technology of IMS
IMS connectivity enables clients to easily integrate IMS across the enterprise: trusted IMS
applications and transactions may become web services. New points of integration for IMS
across the enterprise offer capabilities such as database visualization, query tooling support,
data insight, open access, SQL and .NET support, analytics, etc., contributing to the
modernization of IMS IT infrastructures.
In this part we discuss sample of the enhanced application technologies which allow the
repurposing of IMS data assets as web services, mobile apps, and so on, thus preserving
and extending the ROI of the original investment.
In this part we discuss the following chapters:
255
8174p02.fm
256
8174ch06.fm
Chapter 7.
257
8174ch06.fm
7.1 Overview
Over recent releases, the information in your IMS databases has been made accessible
through an increasing number of avenues. Initially, the only access was through host
applications running on z/OS, using Data Language 1. More recently, distributed access to
IMS data has been possible through Java applications using the JDBC interface.
IMS 13 has added a new dimension to access and update the information in your IMS
databases. The existing Data Language 1 (DL/I) interface continues to be available and
supported for all your applications. When using Enterprise COBOL Version 5, applications
can now access and update information in these same IMS databases using the Structured
Query Language (SQL).
Using the extended database descriptions made possible through the catalog function in IMS
12, these COBOL SQL programs are able to access IMS databases using the relational
column and table paradigm. The SQL supported by IMS is a subset of the full SQL language,
so application programming skills gained through use of DB2 for z/OS and other relational
database management systems are immediately usable in the IMS SQL environment. In this
release, IMS provides support for dynamic SQL.
IMS makes no distinction between applications accessing IMS databases through DL/I, and
applications accessing IMS databases through SQL. These IMS SQL applications are able to
enquire, and update, the same set of IMS databases in the same manner as all existing IMS
application. The DL/I and SQL interfaces can be used in the same program, and can even
access the same databases in the program. These applications can run as Message
Processing Programs (MPPs), Interactive Fast Path (IFP) programs, or Batch Message
Processing (BMP) programs. The IMS databases are accessible through a full IMS TM/DB
system, or through IMS DBCTL. At this time, IMS SQL access is not possible with CICS
applications or DL/I Batch applications.
IMS SQL uses the same environment to access IMS databases as native DL/I applications.
That is, the database is defined through the standard data base description (DBD), and
program access is provided through the standard program specification block (PSB). The
DBD and PSB are used to produce the standard access control block (ACB). The IMS catalog
needs to be populated, either by using the combined ACB Generation and Catalog Populate
utility (DFS3UACB), or the two utilities separately: that is, the ACBGEN utility and the IMS
Catalog Populate utility (DFS3PU00).
IMS SQL applications require the IMS catalog for the definition of all tables (segments) and
columns (fields). The catalog is accessed at runtime for these definitions.
258
8174ch06.fm
FETCH
INCLUDE
INSERT
OPEN
PREPARE
SELECT
UPDATE
WHENEVER
259
8174ch06.fm
WORKING-STORAGE SECTION.
************************************************************
*
These are the SSAs used to retrieve the database
*
*
and PSB information from the catalog
*
*
This is done with the show-catalog procedure
*
************************************************************
01 dbd-ssa.
02 filler
pic x(8) value 'HEADER '.
02 filler
pic x(1) value '('.
02 ssa-field-name pic x(8) value 'RHDRSEQ '.
02 ssa-boolean
pic x(2) value '= '.
02 ssa-field-value pic x(8) value 'DBD
'.
02 ssa-dbd-name
pic x(8).
02 filler
pic x(1) value ')'.
01 psb-ssa.
pic x(8) value 'HEADER '.
02 filler
02 filler
pic x(1) value '('.
02 ssa-field-name pic x(8) value 'RHDRSEQ '.
02 ssa-boolean
pic x(2) value '= '.
02 ssa-field-value pic x(8) value 'PSB
'.
02 ssa-psb-name
pic x(8).
02 filler
pic x(1) value ')'.
77 gur-call
pic x(4) value 'GUR '.
77 sync-call
pic x(4) value 'SYNC'.
01 gur-returned-data.
03 gur-header
pic x(56).
03 gur-information
pic x(15000).
***********************************************************
* This program uses the AIB interface, since the GUR call
* to retrieve information from the catalog requires the
* use of the AIB interface. The program could also use
* CBLTDLI calls if desired, when accessing IMS databases
***********************************************************
01 AIB.
02 AIBRID
PIC x(8).
02 AIBRLEN
PIC 9(9) USAGE BINARY.
02 AIBRSFUNC
PIC x(8).
02 AIBRSNM1
PIC x(8).
02 AIBRSNM2
PIC x(8).
02 AIBRESV1
PIC x(8).
02 AIBOALEN
PIC 9(9) USAGE BINARY.
02 AIBOAUSE
PIC 9(9) USAGE BINARY.
02 AIBRESV2
PIC x(12).
02 AIBRETRN
PIC 9(9) USAGE BINARY.
02 AIBREASN
PIC 9(9) USAGE BINARY.
02 AIBERRXT
PIC 9(9) USAGE BINARY.
260
8174ch06.fm
02 AIBRESA1
USAGE POINTER.
02 AIBRESA2
USAGE POINTER.
02 AIBRESA3
USAGE POINTER.
02 AIBRESV4
PIC x(40).
02 AIBRSAVE
OCCURS 18 TIMES USAGE POINTER.
02 AIBRTOKN
OCCURS 6 TIMES USAGE POINTER.
02 AIBRTOKC
PIC x(16).
02 AIBRTOKV
PIC x(16).
02 AIBRTOKA
OCCURS 2 TIMES PIC 9(9) USAGE BINARY.
* Data Input Area from the terminal
* (not used in this program).
01 INPUT-MESSAGE.
PIC S9(4) COMP.
03 IN-LL
03 IN-ZZ
PIC S9(4) COMP.
03 IN-TRANCODE PIC X(8).
03 IN-DATA.
04 IN-LINE1 PIC X(80).
* Data Output Area from the terminal
* (not used in this program).
01 OUTPUT-AREA.
02 OUT-LL
PICTURE S9(3) COMP VALUE +100.
02 OUT-ZZ
PICTURE S9(3) COMP VALUE +0.
02 OUT-LINE
PICTURE X(96) VALUE SPACES.
02 OUT-DATA REDEFINES OUT-LINE.
04 OUT-TEXT
PIC X(32).
04 OUT-MSG1
PIC X(32).
04 OUT-MSG2
PIC X(32).
*********************************************************
* SQL STRING
*
* In this program, the SQL statement is passed to IMS
* via a working storage text variable. The first two
* bytes are the length of the SQL statement, and the
* rest is the statement itself.
*********************************************************
01 FULL-STATEMENT.
05 SELECT-STATEMENT.
49 SELECT-STATEMENT-LEN PIC S9(4) COMP VALUE +200.
49 STATEMENT-TXT
PIC X(200).
* Miscellaneous fields for this program
77 row-count
PIC 9(6) VALUE 0.
77 loop-count
PIC 9(6) VALUE 0.
*****************************************************
* SQL INCLUDE FOR SQLCA
*
*
IMS SQL Communications Area
*
*****************************************************
EXEC SQLIMS
Chapter 7. COBOL dynamic SQL access to IMS databases
261
8174ch06.fm
INCLUDE SQLIMSCA
END-EXEC.
*****************************************************
* SQL INCLUDE FOR SQLCA
*
*
IMS SQL Descriptor Area
*
*****************************************************
*
* it is retrieved, and displayed for your interest,
* but not used in this program
EXEC SQLIMS
INCLUDE SQLIMSDA
END-EXEC.
*********************************************************
* SQLCODE TEMPLATE TO REMOVE SIGN BIT.
*
*********************************************************
77 SQLIMSCODE-DISP PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
*****************************************************
* district SEGMENT
*
*****************************************************
01 sql-district.
03 sql-distnum
pic x(6).
03 sql-distname
pic x(30).
03 sql-currdate
pic x(6).
03 sql-currtime
pic x(8).
03 sql-custno
pic x(6).
03 sql-distrest
pic x(5).
*****************************************************
LINKAGE SECTION.
01 IOPCB.
02 IO-LTERM
PIC X(8).
02 IO-RESV
PIC X(2).
02 IO-STATUS
PIC X(2).
02 IO-PREF
PIC X(12).
02 IO-MODN
PIC X(8).
02 IO-USERID
PIC X(8).
02 IO-GROUPID
PIC X(8).
01 DBPCB.
02 DBNAME
PICTURE X(8).
02 SEG-LEVEL-NO PICTURE X(2).
02 DBSTATUS
PICTURE XX.
02 FILLER
PICTURE X(2000).
PROCEDURE DIVISION USING IOPCB, DBPCB.
MAIN-Routine.
DISPLAY "COBOL Program sqla12 Execution begins... ".
EXEC SQLIMS
WHENEVER SQLERROR GOTO 100-DBERROR
262
8174ch06.fm
END-EXEC.
EXEC SQLIMS
WHENEVER SQLWARNING GOTO 200-DBERROR
END-EXEC.
EXEC SQLIMS
WHENEVER NOT FOUND CONTINUE
END-EXEC.
perform show-catalog through show-catalog-end .
display "about to process DECLARE TELE1 CURSOR FOR DYSQL".
EXEC SQLIMS
DECLARE TELE1 CURSOR FOR DYSQL
END-EXEC.
MOVE ZERO to LOOP-COUNT.
MOVE "SELECT distnum, distname, currdate, currtime,
"custno, distrest FROM district
"where distnum = '000010'"
TO STATEMENT-TXT.
move 198 to SELECT-STATEMENT-LEN.
display "about to process PREPARE DYSQL FROM :SELECT-".
EXEC SQLIMS
PREPARE DYSQL FROM :FULL-STATEMENT
END-EXEC.
move 6 to SQLIMSn.
exec SQLIMS
describe output dysql into :sqlimsda
end-exec.
perform display-sqlda.
display "about to process OPEN TELE1".
EXEC SQLIMS
OPEN TELE1
END-EXEC.
PERFORM FETCH-DISTRICT
UNTIL SQLIMSCODE NOT EQUAL 0
display "about to perform CLOSE TELE1".
EXEC SQLIMS
CLOSE TELE1
END-EXEC.
PERFORM sync-and-return.
FETCH-DISTRICT.
EXEC SQLIMS
FETCH TELE1 INTO :sql-distnum, :sql-distname,
:sql-currdate,
:sql-currtime,
:sql-custno,
:sql-distrest
END-EXEC.
IF SQLIMSCODE EQUAL 0
ADD 1 TO row-count
Chapter 7. COBOL dynamic SQL access to IMS databases
263
8174ch06.fm
8174ch06.fm
*
*
This routine accesses the IMS catalog information with
*
the Get Unique Record (GUR) call through an
*
Application Interface Block (AIB)
*
*
Applications can use the CBLTDLI, AIB and now the
*
SQL interface to IMS databases in the same program,
*
even to the same database (PCB) if needed.
*
************************************************************
show-catalog.
move "C1CSTP "
to ssa-dbd-name.
move "C1ACSTLD"
to ssa-psb-name.
*
Retrieve the DBD information from the catalog
move "DFSAIB "
to AIBRID.
move length of aib to AIBRLEN.
move length of gur-returned-data to AIBOALEN.
move spaces
to AIBRSFUNC.
MOVE "DFSCAT00"
TO AIBRSNM1.
call 'AIBTDLI' using gur-call
aib
gur-returned-data
dbd-ssa.
set address of dbpcb to aibresa1.
if dbstatus not equal space
display '|' dbstatus '|,' 'aib return is ', AIBRETRN,
',aib reason is ' AIBREASN
else
display "------------ D B D --------------------".
display gur-information .
*
Now retrieve the PSB information from the catalog
call 'AIBTDLI' using gur-call aib
gur-returned-data psb-ssa.
if dbstatus not equal space
display '|' dbstatus '|,' 'aib return is ', AIBRETRN,
',aib reason is ' AIBREASN
else
display " ".
display "------------ P S B --------------------".
display gur-information .
show-catalog-end.
exit.
************************************************************
*
*
This routine displays the information returned
*
from the DESCRIBE STATEMENT request into the
Chapter 7. COBOL dynamic SQL access to IMS databases
265
8174ch06.fm
*
SQL IMS Descriptor Area (SQLIMSDA).
*
************************************************************
display-sqlda.
display "SQLIMSDAID|" SQLIMSdaid
"|SQLIMSDABC|" SQLIMSdabc
"|SQLIMSN|" SQLIMSn
"|SQLIMSD|" SQLIMSd.
perform with test after
varying LOOP-COUNT from 1 by 1
until loop-count > SQLIMSd
display
" ",
loop-count,
" type=", SQLIMSTYPE(loop-count),
" len=" , SQLIMSLEN(LOOP-COUNT),
" namel=", SQLIMSNAMEL(loop-count),
" namec=" SQLIMSNAMEC(LOOP-COUNT),
"|"
end-perform.
END PROGRAM "sqla12".
266
8174ch07.fm
Chapter 8.
This chapter describes the IMS catalog, a trusted online source for both IBM IMS database
and application metadata information, and its use by IMS Open Database and IMS Explorer.
This chapter targets application developers who can benefit from these simplification and
integration functions when they are facing any large-scale deployment of the IMS Open
Database solution.
267
8174ch07.fm
268
8174ch07.fm
relationship. The program view of the hierarchical structure of the database can be
different from the hierarchical structure defined in the DBD. See Figure 8-1.
PSB
PCB
PCB
PCB
PCB
DBD
DBD
DBD
DBD
For online IMS systems, application control block (ACB) libraries contain the metadata used
by IMS, created by performing an ACB generation from the DBD and PSB libraries. The
current system that uses DBD, PSB, and ACB libraries is proprietary. Typically, a DBD defines
only a subset of the fields in a database record, such as the sequence (key) fields and any
fields needed by a secondary index. Other fields in a record are typically defined only in a
COBOL copybook or in a PL/I or C include file used by an application program.
The introduction of Java access to IMS data from JBP or JMP regions, or from remote
systems or clients, required easily accessible metadata. To provide this access, the contents
of ACBLIB are offered as a Java class.
With the move to making IMS data more widely and easily accessible outside of the
mainframe, application programmers need to have easy and consistent access to the
metadata. Since IMS V8, this data has been provided by using the DLIMODEL utility. This
utility generates Java class files, containing a static definition of the database design at the
point when the DLIMODEL utility is run.
The drawback when using the DLIMODEL utility is that it can be a challenge to manage. Also,
change control is needed when the underlying database definition changes. This method
potentially allows the creation of multiple copies of the database metadata, each one of which
must be updated with any database structure change.
There is a requirement for a source of metadata that is easier to manage and can be trusted
to reflect the possible changes of the design of IMS databases. The metadata can also be
defined in an open format.
IMS 12 introduced the IMS catalog. The IMS catalog contains the metadata for databases
and PSBs. It is accessed by using the Java Database Connectivity (JDBC) drivers and is also
available to any tool or application. IMS metadata is available in an Extensible Markup
Language (XML) format, and also available to standard DL/I applications in a traditional IMS
segment format.
When the metadata is updated, the catalog is also updated to reflect the change; therefore,
the data is always current. The data is current because the metadata is accessed dynamically
Chapter 8. The IMS catalog
269
8174ch07.fm
from the active IMS catalog high availability large database (HALDB), rather than from static
class files.
The catalog in IMS also includes a versioning system. This system allows the current version
of the metadata, and a user-specified number of previous versions, to be kept and available
for the applications.
The IMS catalog is a partitioned hierarchical indexed direct access method (PHIDAM)
database that contains trusted metadata for IMS databases and applications. The
IMS Catalog Populate utility (DFS3PU00) can optionally be used to initially populate the
catalog by reading an existing ACBLIB and loading the available metadata into the catalog. All
the information that is contained in the runtime ACBLIB (which was derived from the DBDs
and PSBs) is available to the users in the IMS catalog. Enhancements to the existing
DBDGEN, PSBGEN, and ACBGEN processes allow database and application metadata to
be defined to IMS. The new ACB Generation and Catalog Populate utility (DFS3UACB)
automatically updates the IMS catalog when the ACB members are generated. This update
keeps the catalog in a trusted state at all times after initialization. The IMS catalog is the
single, authoritative source of database and application metadata for all client applications.
The catalog can also contain application metadata such as decimal data specifications (scale
and precision), data structure definitions, and mapping information.
The IMS catalog uses timestamps to identify the version of the metadata for each database,
and can store multiple versions of metadata for each database. IMS provides the facility to
keep a number of generations of this metadata, and remove old metadata, according to a
maximum number of generations or longevity that you specify. By default, the IMS catalog
contains information for each DBD and PSB in the active IMS system ACBLIB. The
IMS Catalog Record Purge utility (DFS3PU10) must be run to remove the extra definitions in
the catalog.
270
8174ch07.fm
PSB resources:
There are a number of new macros in a DBD which allow IMS to better map the application
data structures. They are all an extension of the field macro.
For each macro used in a DBD or PSB, there is an equivalent segment in the IMS catalog
database.
The segments in the DBD of the IMS catalog database are shown in Example 8-1.
Example 8-1 Segments in the IMS catalog database (DFSCD000)
DDDD
D
D
D
D
D
D
D
D
D
D
DDDD
ID=
1* N/A
ID=
2+ N/A
ID=
3" N/A
ID=
4. N/A
SEG-NAME
SC# LV
HEADER
DBD
CAPXDBD .
3 3
DBDRMK
FFFFF SSS
CCC
F
S
S C
C
F
S
C
FFF
SSS C
F
S C
F
S
S C
C
F
SSS
CCC
DDDD
D
D
D
D
D
D
D
D
D
D
DDDD
000
0
0
0 00
0 0 0
00 0
0
0
000
000
0
0
0 00
0 0 0
00 0
0
0
000
000
0
0
0 00
0 0 0
00 0
0
0
000
VERSION=04/18/12 11.49
LEVELS=
8
SEGMENTS= 62
DATA SET GROUPS=
4
PRIME DS LOG. RCD. LEN=
0, BLOCKSIZE= 32752
SEGMENT LENGTH MAX=
614,
OFLW DS LOG. RCD. LEN=
0, BLOCKSIZE= 32752
KEY LENGTH MAX=
17,
PRIME DS LOG. RCD. LEN=
0, BLOCKSIZE= 32752
SEGMENT LENGTH MAX=
934,
OFLW DS LOG. RCD. LEN=
0, BLOCKSIZE= 32752
KEY LENGTH MAX=
2,
PRIME DS LOG. RCD. LEN=
0, BLOCKSIZE= 32752
SEGMENT LENGTH MAX=
934,
OFLW DS LOG. RCD. LEN=
0, BLOCKSIZE= 32752
KEY LENGTH MAX=
2,
PRIME DS LOG. RCD. LEN=
0, BLOCKSIZE= 32752
SEGMENT LENGTH MAX= 4022,
OFLW DS LOG. RCD. LEN=
0, BLOCKSIZE= 32752
KEY LENGTH MAX=
17,
C P P L L P
P P L L E RULES PHYS.
SEG-NAME D-B-NAME
PAR -LEN- ---FREQ--- T T P T P H
C C C C P
N-SEQ
OR
OR
R FB
FB
FB .F .L .F .L S I D R INSRT
FLD-NAME LEN STRT
0
56
0.00
XX
13
P P P LAST
*PFX* LEN= 70 MAX=
56
MIN=
24
1
552
0.00
XX X
10
P P P LAST
*PFX* LEN= 62 MAX=
552
MIN=
505
2
32
0.00
X X
P P P LAST
*PFX* LEN= 18 MAX=
32
MIN=
28
2
264
0.00
XX X
P P P LAST
MIN=
126
MIN=
16
NUMBSEG=
MIN=
66
MIN=
2
NUMBSEG=
MIN=
326
MIN=
2
NUMBSEG=
MIN=
46
MIN=
2
NUMBSEG=
FORM LOG CHLD
OR
INSRT
PNTR RULES
VAR LEN
PFX+MAX=
126
PFX+MIN=
94
VAR LEN
PFX+MAX=
614
PFX+MIN=
567
VAR LEN
PFX+MAX=
50
PFX+MIN=
46
VAR LEN
3
11
3
45
271
8174ch07.fm
DSET
DSETRMK .
AREA
AREARMK .
SEGM
CAPXSEGM.
SEGMRMK .
FLD
FLDRMK
MAR
MARRMK
PROP
LCHILD
LCHRMK
"
"
"
LCH2IDX .
XDFLD
XDFLDRMK.
MAP
MAPRMK
CASE
CASERMK .
CFLD
CFLDRMK .
CMAR
CMARRMK .
CPROP
DBDVEND .
272
6 4
8 4
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
12
12
14
14
17
17
17
20
22
22
24
24
26
26
28
28
96
264
40
264
376
32
264
904
264
704
264
304
72
264
24
200
264
520
264
656
264
904
264
704
264
304
4000
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
XX X
XX X
XX X
P P P
XX X
XX X
P P P
XX X
P P P
XX X
P P P
XX X
XX X
XX X
XX X
P P P
P P P
XX X
XX X
P P P
P P P
XX X
XX X
P P P
P P P
XX X
XX X
P P P
P P P
XX X
XX X
P P P
P P P
XX X
XX X
P P P
P P P
XX X
XX X
P P P
P P P
XX X
XX X
P P P
P P P
XX X
P P P
P P P
P P P
P P P
P P P
P P P
P P P
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
26 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
26 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
42 MAX=
MIN=
*PFX*
LEN=
18 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
30 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
30 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
34 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
26 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
30 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
30 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
30 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
30 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
LAST
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
96 PFX+MAX=
70 PFX+MIN=
VAR LEN
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
40 PFX+MAX=
26 PFX+MIN=
VAR LEN
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
376 PFX+MAX=
341 PFX+MIN=
VAR LEN
32 PFX+MAX=
28 PFX+MIN=
VAR LEN
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
904 PFX+MAX=
836 PFX+MIN=
VAR LEN
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
704 PFX+MAX=
640 PFX+MIN=
VAR LEN
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
304 PFX+MAX=
264 PFX+MIN=
VAR LEN
72 PFX+MAX=
56 PFX+MIN=
VAR LEN
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
24 PFX+MAX=
20 PFX+MIN=
VAR LEN
200 PFX+MAX=
184 PFX+MIN=
VAR LEN
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
520 PFX+MAX=
264 PFX+MIN=
VAR LEN
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
656 PFX+MAX=
400 PFX+MIN=
VAR LEN
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
904 PFX+MAX=
836 PFX+MIN=
VAR LEN
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
704 PFX+MAX=
640 PFX+MIN=
VAR LEN
264 PFX+MAX=
20 PFX+MIN=
VAR LEN
304 PFX+MAX=
264 PFX+MIN=
VAR LEN
4000 PFX+MAX=
64 PFX+MIN=
286
42
122
96
286
42
66
52
286
42
418
383
50
46
286
42
934
866
286
42
734
670
286
42
326
286
106
90
286
42
46
42
226
210
286
42
550
294
286
42
686
430
286
42
934
866
286
42
734
670
286
42
326
286
4022
86
8174ch07.fm
DBDSXXX .
32
135
0.00
XX X
P P P
LAST
VAR LEN
135 PFX+MAX=
157
32 PFX+MIN=
54
VAR LEN
*PFX* LEN= 22 MAX=
135 PFX+MAX=
157
MIN=
32 PFX+MIN=
54
VAR LEN
*PFX* LEN= 22 MAX=
135 PFX+MAX=
157
MIN=
32 PFX+MIN=
54
VAR LEN
*PFX* LEN= 22 MAX=
135 PFX+MAX=
157
MIN=
32 PFX+MIN=
54
VAR LEN
*PFX* LEN= 22 MAX=
128 PFX+MAX=
150
MIN=
32 PFX+MIN=
54
VAR LEN
*PFX* LEN= 50 MAX=
88 PFX+MAX=
138
MIN=
72 PFX+MIN=
122
VAR LEN
*PFX* LEN= 22 MAX=
264 PFX+MAX=
286
MIN=
20 PFX+MIN=
42
VAR LEN
*PFX* LEN= 30 MAX=
288 PFX+MAX=
318
MIN=
208 PFX+MIN=
238
VAR LEN
*PFX* LEN= 22 MAX=
264 PFX+MAX=
286
MIN=
20 PFX+MIN=
42
VAR LEN
*PFX* LEN= 30 MAX=
328 PFX+MAX=
358
MIN=
320 PFX+MIN=
350
VAR LEN
*PFX* LEN= 22 MAX=
264 PFX+MAX=
286
MIN=
20 PFX+MIN=
42
VAR LEN
*PFX* LEN= 26 MAX=
40 PFX+MAX=
66
MIN=
20 PFX+MIN=
46
VAR LEN
*PFX* LEN= 22 MAX=
264 PFX+MAX=
286
MIN=
20 PFX+MIN=
42
SNDIXD
VAR LEN
*PFX* LEN= 22 MAX=
48 PFX+MAX=
70
MIN=
36 PFX+MIN=
58
*LC** DBDPSB
DFSCX000 INDX LAST
*XFD* DBD2PSB SECONDARY INDEXED FIELD
**SRCSEG** **SAME**
**SEARCH** IMSNAME
8
29
PSBNAME
8
37
TSVERS
13
13
**SUBSEQ** /SX1
8
1
VAR LEN
*PFX* LEN= 22 MAX= 4000 PFX+MAX=
4022
MIN=
64 PFX+MIN=
86
VAR LEN
*PFX* LEN= 22 MAX=
135 PFX+MAX=
157
MIN=
32 PFX+MIN=
54
VAR LEN
*PFX* LEN= 22 MAX=
135 PFX+MAX=
157
MIN=
32 PFX+MIN=
54
VAR LEN
*PFX* LEN= 22 MAX=
135 PFX+MAX=
157
MIN=
32 PFX+MIN=
54
VAR LEN
*PFX* LEN= 22 MAX=
128 PFX+MAX=
150
MIN=
32 PFX+MIN=
54
VAR LEN
*PFX* LEN= 26 MAX=
135 PFX+MAX=
161
MIN=
32 PFX+MIN=
58
VAR LEN
*PFX* LEN= 22 MAX= 4000 PFX+MAX=
4022
MIN=
64 PFX+MIN=
86
VAR LEN
*PFX* LEN= 26 MAX=
128 PFX+MAX=
154
MIN=
32 PFX+MIN=
58
VAR LEN
*PFX* LEN= 22 MAX=
128 PFX+MAX=
150
MIN=
32 PFX+MIN=
54
VAR LEN
*PFX* LEN= 22 MAX=
128 PFX+MAX=
150
MIN=
32 PFX+MIN=
54
VAR LEN
*PFX* LEN= 26 MAX=
128 PFX+MAX=
154
MIN=
32 PFX+MIN=
58
VAR LEN
*PFX*
DBDPXXX .
33
135
0.00
XX X
P P P
LAST
DBDRES1 .
34
135
0.00
XX X
P P P
LAST
DBDRES2 .
35
135
0.00
XX X
P P P
LAST
DBDHXXX .
36
128
0.00
XX X
P P P
LAST
PSB
37
88
0.00
XX X
P P P
LAST
PSBRMK
38
37
264
0.00
XX X
P P P
LAST
PCB
39
37
288
0.00
XX X
P P P
LAST
PCBRMK
40
39
264
0.00
XX X
P P P
LAST
SS
41
39
328
0.00
XX X
P P P
LAST
SSRMK
42
41
264
0.00
XX X
P P P
LAST
SF
43
41
40
0.00
XX X
P P P
LAST
SFRMK
44
43
264
0.00
XX X
P P P
LAST
DBDXREF .
45
37
48
0.00
XX X
P P P
LAST
SUBSEQUENCE
PSBVEND .
46
37
4000
0.00
XX X
P P P
LAST
PSBSXXX .
47
37
135
0.00
XX X
P P P
LAST
PSBRES1 .
48
37
135
0.00
XX X
P P P
LAST
PSBRES2 .
49
37
135
0.00
XX X
P P P
LAST
PSBHXXX .
50
128
0.00
XX X
P P P
LAST
DBEXXXX .
51
135
0.00
XX X
P P P
LAST
DBESXXX .
52
51
4000
0.00
XX X
P P P
LAST
UXX
53
128
0.00
XX X
P P P
LAST
UXXOXXX .
54
53
128
0.00
XX X
P P P
LAST
UXXHXXX .
55
128
0.00
XX X
P P P
LAST
SXX
56
128
0.00
XX X
P P P
LAST
SXXOXXX .
57
56
128
0.00
XX X
P P P
LAST
LEN=
22 MAX=
MIN=
273
8174ch07.fm
SXXHXXX .
RESERVE1.
RESERVE2.
RESERVE3.
RESERVE4.
58
59
60
61
62
128
0.00
128
0.00
128
0.00
128
0.00
128
0.00
XX X
P P P
XX X
P P P
XX X
P P P
XX X
P P P
XX X
P P P
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
*PFX*
LEN=
22 MAX=
MIN=
LAST
LAST
LAST
LAST
LAST
128 PFX+MAX=
32 PFX+MIN=
VAR LEN
128 PFX+MAX=
32 PFX+MIN=
VAR LEN
128 PFX+MAX=
32 PFX+MIN=
VAR LEN
128 PFX+MAX=
32 PFX+MIN=
VAR LEN
128 PFX+MAX=
32 PFX+MIN=
VAR LEN
128 PFX+MAX=
32 PFX+MIN=
150
54
150
54
150
54
150
54
150
54
150
54
The hierarchical structure of the IMS catalog database is shown in Figure 8-2. Some segment
types were omitted for display reasons, but most of the important ones are shown.
Example 8-1 shows the complete list. To see the complete picture of the catalog database,
import the catalog database DBD (DFSCD001) into IMS Explorer. The source of this DBD is
available in the SDFSSRC data set delivered with IMS since version 12. Instructions for
importing DBDs into IMS Explorer are in 8.6, Using IMS Explorer to capture IMS metadata
on page 302.
Figure 8-2 shows the database structure for the IMS catalog database.
HEADER
(RESOURCE HE ADER)
DBDHXXX
DBD
CAPX
DBD
DBD
RMK
DSETRMK
(REMARK S)
DSET
AREA
FLDRMK
MAR
(DFSMA RSH)
(REMARKS)
PROP
(PROPERTIES)
PSB
PSBRMK
DBDVEND
(REMARKS)
MARRMK
SEGM
RESERVED
FLD
(FIELD)
LCHRMK
LCH2ID X
(REMARK S)
(INDEX NAME)
LCHILD
XDFLD
DBDXREF
PCBRMK
SS
(REMARKS )
(SE NSEG)
MAPRMK
CASE
SSR MK
SF
(REMARKS)
(DFSCASE)
(REMAKRS )
(SENFLD)
CASERMK
CFLD
SFRMK
(REMARKS)
(REMARKS)
(FIELD)
(REMARKS )
(REMARKS)
CMARRMK
(REMARKS)
PSBVEND
MAP
XDFLDRMK
(DFSMAP)
CFLDRMK
274
PCB
(REMARKS)
RESERVED
CMAR
(DFSMARSH)
CPROP
(PROPERTIES)
8174ch07.fm
There are five PSBs supplied for access and update to the catalog database:
DFSCPL00
It is used for an initial load of the database (PROCOPT=L).
DFSCP000
It has read-only access (PROCOPT=G) for all segments. This PSB can be used for
Assembler and COBOL programs for direct read-only access to the catalog database.
DFSCP001
It has update access (PROCOPT=A) for all segments. This PSB can be used for
Assembler and COBOL programs for direct update access to the catalog database.
DFSCP002
It has read-only access (PROCOPT=G) for all segments. This PSB is used for PL/I
programs for direct read-only access to the catalog database.
DFSCP003
It has read-only access (PROCOPT=G) for all segments. This PSB is used for PASCAL
programs for direct read-only access to the catalog database.
There are several segments in the catalog database, including DBDVEND and PSBVEND, in
the database definition for IBM tools and vendor products to store additional information.
There are also several reserved segments in the database to allow for future expansion.
Most of the segment types (including DBD, DSET, AREA, SEGM, FLD, LCHILD, XFLD)
contain metadata about the specific element that they represent. The data also includes the
name of the segment corresponding to the metadata stored.
Other segments (DBDRMK, DSETRMK, AREARMK, SEGMRMK, MAPRMK, CASERMK)
contain remarks about the element definition.
The CAPXDBD and CAPXSEGM segments contain information about Data Capture exit
routines used.
Installation
IMS catalog initial data population
ACB generation and changes
IMS Catalog Copy utility
Keeping multiple versions of metadata in the catalog
IMS Catalog Record Purge utility
Automatically creating the IMS catalog database data sets
Using the IMS catalog without DBRC
Aliases and sharing
Definitions needed for the IMS catalog
275
8174ch07.fm
IMS provides a number of new utilities to maintain the catalog database when databases or
PSB definitions are changed as part of your normal application development lifecycle.
8.3.1 Installation
The first step of the installation of the IMS catalog is to copy the supplied catalog DBD and
PSB members from the SDFSRESL data set to your own DBD and PSB libraries. See
Example 8-2 for JCL to perform this copy.
The source for the catalog DBD and PSBs is shipped for reference in the IMS source library
SDFSSRC. However, the object code in SDFSRESL must be used for execution.
Example 8-2 Copy the supplied DBD and PSB members to your own libraries
//CPYCMEM EXEC PGM=IEBCOPY
//SDFSRESL DD DSN=IMS12.SDFSRESL,DISP=SHR
//DBDLIB
DD DSN=IMS12.IMS12X.DBDLIB,DISP=SHR
//PSBLIB
DD DSN=IMS12.IMS12X.PSBLIB,DISP=SHR
//SYSIN
DD *
COPY OUTDD=DBDLIB,INDD=((SDFSRESL,R))
SELECT MEMBER=(DFSCD000,DFSCX000)
COPY OUTDD=PSBLIB,INDD=((SDFSRESL,R))
SELECT MEMBER=(DFSCPL00,DFSCP000,DFSCP001,DFSCP002,DFSCP003)
After the DBDs and PSBs are copied to your libraries, you need to build them as ACBs by
using the traditional ACB process as shown in Example 8-3.
Example 8-3 ACBGEN for IMS catalog
// JCLLIB ORDER=IMS12.PROCLIB
// EXEC ACBGEN
//SYSIN
DD *
BUILD PSB=(DFSCPL00)
BUILD PSB=(DFSCP001)
BUILD PSB=(DFSCP000)
BUILD PSB=(DFSCP002)
BUILD PSB=(DFSCP003)
Next, create the catalog database data sets. The space allocated for the catalog database
needs to be sufficient to store the number of DBD and PSB definitions for your environment.
This creation can be done in three ways:
The database data sets can be allocated with the job control language (JCL) similar to
what is shown in Example 8-4.
The IMS Catalog Partition Definition Data Set utility (DFS3UCD0) can be used to create
the catalog partition definition database data set if DBRC is not in use. It also creates the
database data sets for the catalog database.
The IMS Catalog Populate utility (DFS3PU00) is used to load or insert records into the
catalog database, whether DBRC is used for the catalog database or not. If any of the
database data sets do not exist, the utility creates them. The size parameters used for
automatic creation are specified in the catalog section of the DFSDFxxx procedure library
(PROCLIB) member.
Example 8-4 shows the process of defining the database data sets and indexes.
Example 8-4 Define the HALDB data sets, the ILDS, and the primary and secondary indexes
//PHIDAM EXEC PGM=IDCAMS
276
8174ch07.fm
//SYSPRINT DD SYSOUT=*
ALLOCATE DSNAME('IMS12.IMS12X.DFSCDI2D.A00001') FILE(A00001) RECFM(F,B,S) DSORG(PS) NEW CATALOG SPACE(2,2) CYLINDERS VOLUME(SBOXI5) UNIT(SYSALLDA)
ALLOCATE DSNAME('IMS12.IMS12X.DFSCDI2D.B00001') FILE(B00001) RECFM(F,B,S) DSORG(PS) NEW CATALOG SPACE(2,2) CYLINDERS VOLUME(SBOXI5) UNIT(SYSALLDA)
ALLOCATE DSNAME('IMS12.IMS12X.DFSCDI2D.C00001') FILE(C00001) RECFM(F,B,S) DSORG(PS) NEW CATALOG SPACE(2,2) CYLINDERS VOLUME(SBOXI5) UNIT(SYSALLDA)
ALLOCATE DSNAME('IMS12.IMS12X.DFSCDI2D.D00001') FILE(D00001) RECFM(F,B,S) DSORG(PS) NEW CATALOG SPACE(2,2) CYLINDERS VOLUME(SBOXI5) UNIT(SYSALLDA)
DEFINE CLUSTER(NAME('IMS12.IMS12X.DFSCDI2D.L00001') FREESPACE(80 10) SHAREOPTIONS(3 3) KEYS(9 0) RECORDSIZE(50 50) SPEED CYLINDERS(1,1) VOLUMES(SBOXI5)) DATA(CONTROLINTERVALSIZE(4096)) INDEX(CONTROLINTERVALSIZE(2048))
DEFINE CLUSTER(NAME('IMS12.IMS12X.DFSCDI2D.X00001') INDEXED KEYS(16,5) VOL(SBOXI5) REUSE RECORDSIZE (22,22)) DATA(CONTROLINTERVALSIZE(4096))
//PSINDEX EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
DEFINE CLUSTER (NAME('IMS12Q.IMS12X.DFSCXI2D.A00001') INDEXED SHAREOPTIONS(3 3) KEYS(37,45) REUSE RECORDS(5,5) VOL(SBOXI5) RECORDSIZE(82,82)) DATA(CONTROLINTERVALSIZE(4096))
After the database data sets are created, you need to update the IMS.PROCLIB(DFSDFxxx)
member to define the catalog parameters for your IMS system. There are two sections to be
added to the member, depending on which of the following configurations you choose to use:
Example 8-5 shows the simplest environment: a single IMS with a single catalog prefixed with
the default name DFSC.
Example 8-5 IMS.PROCLIB(DFSDFxxx) for a single IMS system
*--------------------------------------------------------------------*
* IMS CATALOG SECTION
*
*--------------------------------------------------------------------*
<SECTION=CATALOG>
CATALOG=Y
ALIAS=DFSC
Example 8-6 shows a shared DFSDFxxx member with a separate IMS catalog for each IMS
system (defined with an ALIAS that matches the IMSID). We explain the use of aliases for the
IMS catalog in 8.3.9, Aliases and sharing on page 284.
277
8174ch07.fm
The catalog can be activated, by using the new DFSDFxxx member, with a cold start, warm
start, or even an emergency restart of the IMS system. The restart is required because IMS
only reads the DFSDF member during initialization.
278
8174ch07.fm
DFSDFxxx member
in IMS.PROCLIB
Catalog Definition
DBRC comman ds
ACBLIB
Catalog
DBDLIB
Populate
Cata log
Utility
PS BLIB
The utility reads the IMS.PROCLIB(DFSDFxxx) member, then builds the IMS catalog from the
ACB libraries referenced in the JCL. The utility also reads the DBD and PSB libraries to
capture the information about any generalized sequential access method (GSAM) DBDs. This
method is used because they are not built as ACB library members.
After execution, a HALDB REORG record is recorded in the RECON.
The IMS Explorer allows us to add application metadata to these database definitions. This
process is needed because, at this stage, the IMS catalog holds only the rudimentary
information that is available from the DBD and PSB definitions. For details about this process,
see 8.5, The role of the IMS Enterprise Suite Explorer for Development on page 299.
Example 8-7 shows the JCL used to populate an IMS catalog from the current
ACB libraries.
Example 8-7 Running the IMS Catalog Populate utility (DFS3PU00)
//LOADCAT EXEC PGM=DFS3PU00,
// PARM=(DLI,DFS3PU00,DFSCPL00,,,,,,,,,,,Y,N,,,,,,,,,,,,'DFSDF=12D')
//STEPLIB DD DSN=IMS12.SDFSRESL,DISP=SHR
//DFSRESLB DD DSN=IMS12.SDFSRESL,DISP=SHR
//IMS
DD DSN=IMS12.IMS12X.PSBLIB,DISP=SHR
//
DD DSN=IMS12.IMS12X.DBDLIB,DISP=SHR
//PROCLIB DD DSN=IMS12.PROCLIB,DISP=SHR
//SYSABEND DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//IEFRDER DD DISP=(,CATLG),DSN=IMS12.IMS12X.PU000.LOG(+1),
// SPACE=(TRK,(5,5),RLSE),UNIT=SYSALLDA
//DFSVSAMP DD DSN=IMS12.PROCLIB(DFSVSMDB),DISP=SHR
//IMSACB01 DD DSN=IMS12.IMS12D.ACBLIBA,DISP=SHR
//IMSACB02 DD DSN=IMS12.IMS12D.ACBLIB.DOPT,DISP=SHR
279
8174ch07.fm
PSBLIB
DBDLIB
ACBGEN
and
Catalog
Populate
ACBLIB
Catalog
DFSDFxxx
The new ACB Generation utility writes logs. If the IMS catalog is defined in DBRC, it updates
the RECON. It can run as a batch message program (BMP) or DLIBATCH utility. If it is run as
a BMP, ensure that the catalog database is opened by IMS for update access. Usually, IMS
opens the catalog database in read-only mode.
8174ch07.fm
This utility copies an IMS catalog and any included ACB, DBD, and PSB libraries to export
data sets in the same job step.
The utility DFS3CCI0 imports from the export data set into another catalog, ACBLIB,
DBDLIB, and PSBLIB libraries.
At the destination environment, the import module DFS3CCI0 loads or updates an IMS
catalog. The module also copies any included ACB, DBD, and PSB libraries from the export
data sets into their destination data sets.
For the import function of the IMS Catalog Copy utility, the primary input to the utility is a data
set that contains the new copy of the IMS catalog. A CCUCATIM data definition (DD)
statement is required to identify this data set.
If the ACB libraries, DBD libraries, and PSB libraries were copied during the export function,
they are identified in the import JCL by the following DD statements:
CCUACBIM DD statement for the ACB library export data set
CCUDBDIM DD statement for the DBD library export data set
CCUPSBIM DD statement for the PSB library export data set
The new utilities ensure that the updates to the ACB libraries result in parallel updates to the
IMS catalog.
Optionally, the IMS Catalog Copy utility can also create copies of the ACB, DBD, and PSB
library members that correspond to the IMS catalog records that are copied.
The IMS Catalog Copy utility creates an import statistics report for the record segments to be
loaded or updated in the IMS catalog. When the Catalog Copy utility runs in analysis-only
mode, the report reflects only certain statistics. The report reflects only the potential statistics
if the IMS catalog were loaded or updated from the ACB libraries that are currently used as
input to the utility.
The IMS Catalog Copy utility can be run as either a batch job or as an online BMP.
281
8174ch07.fm
DAYS defines the minimum number of days a version remains in the catalog. The value
can be from 0 to 65535; the default value is 0 (function disabled). When a version of the
catalog metadata is older that the specified version, it becomes a candidate for removal. It
might be removed when new versions of the same DBD or PSB are added to the
IMS catalog.
These parameters work in the same way that GENMAX and RECOVPD work with DBRC: If
the maximum number of versions is reached but the retention period has not expired, a new
catalog record is kept. The oldest record is not removed.
Example 8-8 shows the specification in the IMS.PROCLIB(DFSDFxxx) member, where at
least five generations of metadata is kept, for a minimum of 30 days.
Example 8-8 Setting default maximum generations and retention periods for catalog metadata
<SECTION=CATALOG>
CATALOG=Y
ALIAS=DFSC
RETENTION=(VERSIONS=5,DAYS=30)
With multiple versions stored in the catalog, if an online change is reversed, the catalog might
still have the previous version available.
For logically related databases, where in the past the DBD information is kept only in the
DBDLIB and not the ACBLIB, the Catalog Populate utility sets the timestamp to zero. The
timestamp is set to zero until the combined ACBGEN/Populate utility runs for those
databases.
Metadata information in the catalog can be removed by the IMS Catalog Record Purge utility
(DFS3PU10) if it is outdated or if the version exceeds the specified retention value. When
using DFS3PU10, the default of two versions applies. If no retention value is specified, each
execution of ACBGEN or Populate Utility adds a version.
282
8174ch07.fm
283
8174ch07.fm
KEYSTHEX=FFFFFFFFFFFFFFFFFFFFFFFFFFFF)
HALDB=(NAME=DFSCX000,HIKEY=YES)
PART=(NAME=DFSCX000,
PART=DFSCX01,
DSNPREFX(IMSTESTS.DFSCX000)
KEYSTHEX=FFFFFFFFFFFFFFFFFFFFFFFFFFFF)
The next thing you need to add is a statement in the IMS.PROCLIB(DFSDFxxx) member to
define the IMS catalog that is not registered in DBRC (Example 8-11).
Example 8-11 IMS.PROCLIB(DFSDFxxx) definition for a non-DBRC IMS catalog
<SECTION=DATABASE>
UNREGCATLG=DFSCD000
Optionally, to avoid making JCL changes, you can also build a DFSMDA dynamic allocation
macro to define the DFSHDBSC to IMS, as shown in Example 8-12. TYPE=CATDBDEF is a
new specification just for an unregistered IMS catalog database.
Example 8-12 DFSMDA definition
DFSMDA TYPE=INITIAL
DFSMDA TYPE=CATDBDEF,DSNAME=IMS12.IMS12D.CATALOG.DEFDS
DFSMDA TYPE=FINAL
END
284
8174ch07.fm
Figure 8-5 shows the migration of a system from an IMSplex where each IMS has its own
cloned ACB library pair. However, we also introduce a single shared IMS catalog populated
from all the existing ACB libraries.
IMS1
ACBLIBA
DFSDF member
<SECTION=CATALOG>
CATALOG=Y
ALIAS=DFSC
ACBLIBB
ACBLIBA
Catalog
IMS2
ACBLIBA
ACBLIBB
ACBLIBB
DFSDF member
<SECTION=CATALOG>
CATALOG=Y
ALIAS=DFSC
DFSDF member
<SECTION=CATAL OG>
CATALOG=Y
AL IAS=DFSC
D FSDF memb er
<SECTION=CATALOG>
C ATALOG=Y
ALIAS=DFSC
IMS3
ACBLIBA
IMS4
ACBLIBB
Figure 8-5 Multiple IMS, cloned ACBLIB, and shared IMS catalog
Figure 8-6 shows a system where we are starting from separate (cloned)
ACB libraries. We chose to create a unique aliased IMS catalog for each IMS system.
285
8174ch07.fm
IMS1
ACBLIBA
DFSDF member
<SECTION=CATALOG>
CATALOG=Y
ALIAS=IMS1
ACBLIBB
Catalog
(IMS1)
ACBLIBA
IMS2
Catalog
(IMS3)
Catalog
(IMS2)
IMS3
ACBLIBA
ACBLIBB
ACBLIBB
DFSDF membe r
<SECTION=CATALOG>
CATAL OG=Y
ALIAS=IMS2
DFSDF member
<SECTION=CATALOG>
CATALOG=Y
ALIAS=IMS3
Catalog
(IMS4)
DFSDF member
<SECTION=CATALOG>
CATALOG=Y
ALIAS=IMS4
ACBLIBA
IMS4
ACBLIBB
Figure 8-6 Multiple IMS, cloned ACBLIB, and one IMS catalog for each IMS
Figure 8-7 shows the integrated system, where there is one pair of ACB libraries for the
IMSplex and a single shared IMS catalog (registered in DBRC with SHARELVL=3). In this
system, global online change and member online change are used.
IMS1
DFSDF member
<SECTION=CATALOG>
CATALOG=Y
ALIAS=DFSC
ACBLIBA
IMS2
Catalog
ACBLIBA
DFSDF member
<SECTION=CATALOG>
CATALOG=Y
ALIAS=DFSC
DFSDF member
<SECTION=CATALOG>
CATALOG=Y
ALIAS=DFSC
IMS4
Figure 8-7 Multiple IMS, shared ACBLIBs, and shared IMS catalog
286
IMS3
DFSDF member
<SECTION=CATALOG>
CATALOG=Y
ALIAS=DFSC
8174ch07.fm
IMS handles loading the DBDs (DFSCD000 and DFSCX000(, and the PSBs (DFSCP000,
DFSCP001, DFSCP002, and DFSCP003). IMS also makes the internal changes needed
when aliased names. are used.
Alternatively, if you have two or more IMS systems that use shared queues, you might want
them to share a single IMS catalog and the same DFSDFxxx proclib member. In this case,
you can define different section suffixes in the CATALOG statement by using the IMS ID. And
you can define the catalog database with a single shared ALIAS name. See Example 8-14.
Example 8-14 Multiple IMS systems
<SECTION=CATALOGI12A>
CATALOG=Y
ALIAS=I12Q
<SECTION=CATALOGI12C>
CATALOG=Y
ALIAS=I12Q
287
8174ch07.fm
288
8174ch07.fm
PATTERN
An optional field that specifies the pattern to use for the date, time, and timestamp Java
data types.
The PATTERN parameter applies only when the DATE, TIME, or TIMESTAMP is specified
on the DATATYPE keyword in the FIELD statement. Also, CHAR must be specified on the
INTERNALTYPECONVERTER keyword in the DFSMARSH statement.
DFSMAP statement
The DFSMAP statement enables the alternate mapping of fields within a segment.
The DFSMAP statement defines a group of one or more map cases and relates the cases to
a control field. The control field identifies which map case is used in a particular segment
instance, as shown in Figure 8-8.
NAME
Defines the name of this map.
DEPENDING ON
External name of the control field within this segment that contains the value that
determines which map case is used for a particular segment instance. If the control field
does not contain a value that corresponds to a CASEID in a DFSCASE statement for this
map, the map is not used for this segment instance.
If the FIELD statement that defines the control field does not explicitly code the
EXTERNALNAME parameter, specify the value of the NAME parameter in the
DEPENDING ON field.
REMARKS
Allow for a comment up to 256 characters long to be recorded in the DBD and the IMS
catalog database.
DFSCASE statement
Many applications allow for several different layouts for the same segment type in an IMS
database. Typically, this configuration is done in COBOL with the REDEFINES statement, and
in PL/I with the DEFINED statement. The corresponding facility in IMS is the DFSCASE
statement, which defines a map case: A conditional mapping of a set of fields in a segment.
Each map case has a name and an identifier (ID). A single segment can be defined with
multiple map cases. The map cases within a segment are grouped by the DFSMAP
statement, which also associates the map cases with their control field.
289
8174ch07.fm
Each map case is defined with a case ID. The case ID is stored in the control field to identify
which case map is used for a particular segment instance. Typically, the control field is
defined at the beginning of the segment, before the DFSMAP statement.
The fields that make up a map case identify the map case that they belong to by the name on
the CASENAME parameter in the FIELD statement. CASENAME is valid and required only to
associate a FIELD statement with the preceding DFSCASE statement that defines the map
case to which this field belongs. The value of CASENAME must match the value specified on
the NAME parameter of the DFSCASE statement.
The ID of a map case is specified on the CASEID parameter. In a segment instance, the ID is
inserted in a control field to indicate which map case is in use:
NAME
Defines the name of this case.
CASEIDTYPE
Defines the data type of the value specified in the CASEID parameter.
MAPNAME
The name of the map that this case belongs to, as specified on the NAME parameter in
the DFSMAP statement.
CASEID
Defines a unique identifier for the case. A segment instance specifies the CASEID value in
a user-defined control field when part or all of the field structure of the segment is mapped
by this case. The CASEID must be unique within the map to which the case belongs.
REMARKS
Allow for a comment of up 256 characters to be recorded in the DBD and the IMS catalog
database.
290
8174ch07.fm
Specifies the name of this field within a segment type. The name must be provided to be
able to search on the field.
For key-sequenced field types and field types that are referenced by an XDFLD statement,
the NAME parameter is required.
For other field types, you can optionally omit the NAME parameter when the
EXTERNALNAME parameter is specified.
PARENT
Specifies the name of a field that is defined as a structure or array in which this field is
contained. Must be the value of the EXTERNALNAME parameter in the definition of the
referenced field.
The referenced field must be defined with either DATATYPE=ARRAY or
DATATYPE=STRUCT.
CASENAME
The name of the map case to which this field belongs.
This parameter is required only to associate a field statement with the preceding
DFSCASE statement that defines the map case.
This parameter must match the value specified on the NAME parameter of the DFSCASE
statement.
DATATYPE
This parameter is an optional value that specifies one of the following external data types
for the field:
ARRAY, BINARY, BIT, BYTE, CHAR, DATE, DECIMAL (with precision and scale),
DOUBLE, FLOAT, INT, LONG, OTHER, SHORT, STRUCT, TIME, TIMESTAMP, and XML.
REDEFINES
This is a field that specifies the name of another field in the segment. The field must be the
same length as the field that is redefined.
The field cannot be an ARRAY or contain an ARRAY.
EXTERNALNAME
This parameter is an optional alias for the NAME= parameter. Java application programs
use the external name to refer to the field.
The EXTERNALNAME parameter is required only when the NAME parameter is not
specified. If the NAME parameter is not specified, you cannot search on this field.
DEPENDSON
This parameter specifies the name of a field that defines the number of elements in a
dynamic array. Referenced fields must precede the field statement that specifies this
parameter.
The name specified must be the value, whether explicitly defined or accepted by default, of
the EXTERNALNAME parameter in the definition of the referenced field.
The DEPENDSON parameter is valid only when DATATYPE=ARRAY is also specified.
The field referenced by the DEPENDSON parameter must be defined with one of the
following DATATYPE values: INT, SHORT, LONG, DECIMAL.
MINOCCURS
Valid for the DATATYPE=ARRAY only, a MINOCCURS is a required numeric value that
specifies the minimum number of elements in an ARRAY. MINOCCURS is invalid for all
other data types.
Chapter 8. The IMS catalog
291
8174ch07.fm
MAXOCCURS
Valid for the DATATYPE=ARRAY only, a MAXOCCURS is a required numeric value that
specifies the maximum number of elements in an ARRAY.
MAXOCCURS must be greater than or equal to MINOCCURS, but not zero.
MAXBYTES
This parameter specifies the maximum size of a field in bytes when the byte-length of the
field instance can vary based on the number of elements in a dynamic array. MAXBYTES
and BYTES are mutually exclusive.
The value of MAXBYTES must be greater than or equal to the maximum total of the byte
values of all fields nested under this field.
The MAXBYTES parameter is required and valid only in the following cases:
The field is defined as a dynamic array.
For a field defined as a static array or for a structure that contains a nested field that is
defined as a dynamic array.
STARTAFTER
This parameter specifies the name of the field that directly precedes this field in the
segment. The name specified must be the value of the EXTERNALNAME parameter in
the definition of the referenced field.
STARTAFTER is required and valid only when the starting position of a field cannot be
calculated. The starting position cannot be calculated because the field is preceded at a
prior offset by a field defined as a dynamic array.
The STARTAFTER parameter cannot be specified on fields that define an array field as a
parent.
RELSTART
This parameter specifies the starting position of a field that is defined as an element of an
array or a structure:
For fields that specify an array field as a parent, RELSTART is required.
For fields that specify a structure as a parent, RELSTART is required only when a
dynamic array precedes the structure at any prior offset in the segment.
RELSTART is the starting byte offset of the field relative to the start of the array or
structure.
292
8174ch07.fm
293
8174ch07.fm
Example 8-15 Sample application that uses the GUR DL/I call
Identification division.
program-id. gur.
Environment division.
Data division.
Working-storage section.
01 dli-insert pic x(4) value 'ISRT'.
01 dli-gur
pic x(4) value 'GUR'.
01 dli-gu
pic x(4) value 'GU'.
01 header-ssa.
02 filler
pic x(8) value 'HEADER '.
02 filler
pic x(1) value '('.
02 ssa-field-name pic x(8) value 'RHDRSEQ '.
02 ssa-boolean
pic x(2) value '= '.
02 ssa-field-value pic x(16) value 'DBD
S2U1DBD '.
02 filler
pic x(1) value ')'.
01 AIB.
02 AIBRID
PIC x(8).
02 AIBRLEN
PIC 9(9) USAGE BINARY.
02 AIBRSFUNC
PIC x(8).
02 AIBRSNM1
PIC x(8).
02 AIBRSNM2
PIC x(8).
02 AIBRESV1
PIC x(8).
02 AIBOALEN
PIC 9(9) USAGE BINARY.
02 AIBOAUSE
PIC 9(9) USAGE BINARY.
02 AIBRESV2
PIC x(12).
02 AIBRETRN
PIC 9(9) USAGE BINARY.
02 AIBREASN
PIC 9(9) USAGE BINARY.
02 AIBERRXT
PIC 9(9) USAGE BINARY.
02 AIBRESA1
USAGE POINTER.
02 AIBRESA2
USAGE POINTER.
02 AIBRESA3
USAGE POINTER.
02 AIBRESV4
PIC x(40).
02 AIBRSAVE
OCCURS 18 TIMES USAGE POINTER.
02 AIBRTOKN
OCCURS 6 TIMES USAGE POINTER.
02 AIBRTOKC
PIC x(16).
02 AIBRTOKV
PIC x(16).
02 AIBRTOKA
OCCURS 2 TIMES PIC 9(9) USAGE BINARY.
01 gur-returned-data pic x(32000).
Linkage section.
1 io-pcb.
3 filler
pic x(60).
1 db-pcb.
3 filler
pic x(10).
3 status-code
pic x(2).
3 filler
pic x(20).
Procedure division using io-pcb db-pcb.
move "DFSAIB "
to AIBRID.
move length of aib to AIBRLEN.
move length of gur-returned-data to AIBOALEN.
move spaces
to AIBRSFUNC.
MOVE "DFSCAT00"
TO AIBRSNM1.
call 'AIBTDLI' using dli-gur aib
gur-returned-data header-ssa.
294
8174ch07.fm
The first few lines of the data returned by the GUR call from the program (shown in
Example 8-15), are shown in Example 8-16. The first 56 characters in the IOAREA are not
part of the XML document.
Example 8-16 Sample data returned by a GUR call
_%
?>
> ? >
/> /%?>
`
<ns2:dbd xmlns:ns2="http://www.ibm.com/ims/DBD" dbdName="S2U1DBD
" timestamp="1215015125765" version="02/10/1114.51" xmlSchemaVersion="1"><access dbType="HIDAM"><hidam datxexit="N" pass
word="N" osAccess="VSAM"><dataSetContainer><dataSet ddname="S2U1DB" label="DSG1" searchA="0" scan="3"><block size="0"/>
<size size="0"/><frspc fspf="0" fbff="0"/></dataSet></dataSetContainer></hidam></access><segment imsName="CUSTROOT" name
="CUSTROOT" encoding="Cp1047"><hidam label="DSG1"><bytes maxBytes="76"/><rules insertionRule="L" deletionRule="L" replac
ementRule="L" insertionLocation="LAST"/><pointer physicalPointer="TWINBWD" lparnt="N" ctr="N" paired="N"/></hidam><field
imsDatatype="C" imsName="CUSTNO" name="CUSTOMERNUMBER" seqType="U"><startPos>1</startPos><bytes>4</bytes><marshaller><t
ypeConverter>BINARY</typeConverter></marshaller><applicationDatatype datatype="BINARY"/></field><field imsDatatype="C" n
ame="FIRSTNAME"><startPos>5</startPos><bytes>10</bytes><marshaller encoding="Cp1047"><typeConverter>CHAR</typeConverter>
</marshaller><applicationDatatype datatype="CHAR"/></field><field imsDatatype="C" name="LASTNAME"><startPos>15</startPos
><bytes>20</bytes><marshaller encoding="Cp1047"><typeConverter>CHAR</typeConverter></marshaller><applicationDatatype dat
atype="CHAR"/></field><field imsDatatype="C" name="DATEOFBIRTH"><startPos>35</startPos><bytes>10</bytes><marshaller enco
ding="Cp1047"><typeConverter>CHAR</typeConverter></marshaller><applicationDatatype datatype="CHAR"/></field><field imsDa
tatype="C" name="HOUSENAME"><startPos>45</startPos><bytes>20</bytes><marshaller encoding="Cp1047"><typeConverter>CHAR</t
ypeConverter></marshaller><applicationDatatype datatype="CHAR"/></field><field imsDatatype="C" name="HOUSENUMBER"><start
A better way to display this XML information is through a browser. Example 8-17 shows the
same information as displayed by Microsoft Internet Explorer.
Example 8-17 Sample data returned by a browser
<ns2:dbd xmlns:ns2="http://www.ibm.com/ims/DBD" dbdName="S2U1DBD" timestamp="1215015125765"
version="02/10/1114.51" xmlSchemaVersion="1">
<access dbType="HIDAM">
<hidam datxexit="N" password="N" osAccess="VSAM">
<dataSetContainer>
<dataSet ddname="S2U1DB" label="DSG1" searchA="0" scan="3">
<block size="0" />
<size size="0" />
<frspc fspf="0" fbff="0" />
</dataSet>
</dataSetContainer>
</hidam>
</access>
<segment imsName="CUSTROOT" name="CUSTROOT" encoding="Cp1047">
<hidam label="DSG1">
<bytes maxBytes="76" />
<rules insertionRule="L" deletionRule="L" replacementRule="L" insertionLocation="LAST" />
<pointer physicalPointer="TWINBWD" lparnt="N" ctr="N" paired="N" />
</hidam>
295
8174ch07.fm
The XML schemas for the documents returned as responses to this call, are included in the
IMS.ADFSSMPL data set:
DFS3XDBD.xsd (for DBD records)
DFS3XPSB.xsd (for PSB records)
SSAs can be specified only up to the DBD or PSB level in the catalog database
No more than two SSAs can be specified:
One for the root HEADER segment
One for the DBD or PSB segment
Example 8-18 shows the IMS Test Program (DFSDDLT0) statements that are needed to
process a GUR call. The DATA statement is needed to provide sufficient IO-AREA for the
XML document that contains the database definition to be returned to DSFSDDLT0.
Example 8-18 DFSDDLT0 statements for GUR
S 1 1 1 1 1
DFSCD000
AIB
L
GUR HEADER (RHDRSEQ ==DBD
L Z9999 DATA
S2U1DBD )
8174ch07.fm
ACBLIB
Users
Direct
access
DLI
Distributed
Access
(Ja va)
Type 4
PSB
pool
DMB
pool
Catalog PSB
DF SCP001
4 attach
Ims
connect
Catalog PSB
DF SCP001
ODBM
Type 2
Catalog PSB
DF SCP001
MYD
MYDATBAS
Catalog DBD
DF SCD000
Appl DBD
MYDATBAS
Catalog
User PSB
MYPCB
Type 2
WAS
DB2 StoredProc
CICS
Attached PSB
Indirect
access
The catalog PCB is used by the DL/I engine without any external effects on the calling
application. The normal mode of operation is that you are only reading the IMS catalog with a
PROCOPT=G (read with integrity). The name of the main catalog PCB is DFSCAT00.
For message processing program (MPP) applications (running in an online IMS), the dynamic
attach of a PSB that contains the IMS catalog PCB occurs at the first reference, that is during
the first DL/I call. The database is accessed with deferred scheduling, so the scheduling only
occurs when the first call is made that needs access to the IMS catalog. The IMS catalog
database availability does not affect application availability. If the IMS catalog is offline, you
can get an abend (U3303), but that does not cause the application to terminate.
In a DL/I batch environment, the dynamic attach of the IMS catalog PCB occurs during the
batch initialization. Scheduling is only done once for the batch when the region starts. A batch
job loads the IMS catalog PSB for later reference if the catalog is enabled in the DFSDFxxx
PROCLIB member.
297
8174ch07.fm
In Figure 8-10, an SSA search on the field is issued, although the type is not known by the
DBD.
DBD
Field
Labname
Street
State
Offset
1
10
30
Len
5
20
2
Segment name
SSA qualification(s)
Offset
Length
COBOL Copybook
Field
Labname
Type
Street
State
Offset
1
6
10
30
Len
5
3
20
2
Offset
Length
Field level sensitivity allows the user to change the layout of the segment that is returned in
the I/O area. The fields can be reordered, omitted, or spaces can be added between, as
shown in Figure 8-11. The new SSA qualifications can be used in combination with the
existing SSA qualification format. For example, the following SSA combination is valid for the
fields: labname and type.
GU IBMLABS*O (LABNAME =SVL
&00000006 00000003=DEV)
Salary
Address
Phone
Address
Phone
In this request, the SSA offset is relative to the physical starting position in the segment that is
visible to your program. If you attempt to search for fields that are outside of the sensitive area
(that is, past the end of the segment), IMS returns an AK status code. If a segment is not
found that matches the SSA qualifications, a GE or GB status code is returned.
298
8174ch07.fm
PSB/DBD
sources
ftp export
EXPLORER
PSB/DBD
sources
ftp import
type4
D BD GEN
PS BGEN
DBDLIB
PSBLIB
ACBLIB
A CB GEN
Populate
utility
Populate
utility
catalog
Cobol/PLI
Copybooks
includes
Distributed z/OS
Figure 8-12 IMS Explorer and catalog
A direct update from the explorer is not available. An intermediate application control block
generation (ACBGEN) with population of the catalog is required.
299
8174ch07.fm
The DLIModel utility is a helpful tool for visualizing the structure of an IMS database. The tool
documents the details of the DBD and PSB sources. The DLIModel utility is required to
produce the com.ibm.ims.db.DLIDatabaseView class for accessing the IMS databases from
Java applications on the remote and local locations. This access is through the type 4 and
type 2 drivers. Both the traditional DL/I SSA and JDBC access can be used.
The DLIModel utility was not changed in Enterprise Suite V2, but its functions were integrated
into the IMS Enterprise Suite Explorer for Development. The IMS Explorer uses the
centralized IMS catalog on IBM z/OS. The metadata that is currently available in the
DatabaseView class is integrated in the IMS catalog. The concept of the IMS catalog makes
the metadata more dynamic and shared. Its implementation avoids the need for distributing
the class to all sites where it might be used in Java programs with DL/I (or JDBC) access. The
access is through the IMS database type 2 and type 4 Universal drivers. The drivers were
adapted to provide this function.
The following features summarize the IBM Enterprise Explorer:
Incorporates DLIModel functionality
Support for migration of DLIModel projects is provided
Provides the following graphical editors for development and visualization:
Data Base Description (DBD)
Program Specification Block (PSB)
Shows a relational view of IMS data with graphical assistance to build SQL statements
The IMS Universal JDBC type 4 connectivity extracts DBD and PSB information for local
enhancement.
300
8174ch07.fm
An ACBGEN of the changed PSB or DBD is needed to update the ACBLIB and populate this
updated information to the catalog.
301
8174ch07.fm
302
8174ch07.fm
To create an IMS Explorer Project, right-click in the Project Explorer window (upper left), and
select New Project to start the Create a New Project wizard (Figure 8-15).
303
8174ch07.fm
The wizard is the IMS Explorer Project wizard. Select this one, and click Next. See
Figure 8-16.
304
8174ch07.fm
Enter a name for the IMS Explorer Project in the pane of Figure 8-17.
When the wizard completes, Rational Developer for IBM System z (RDz) shows the named
project in the Project Explorer window (see Figure 8-18).
305
8174ch07.fm
Next, you must import the DBD for the databases for which you are going to capture the
metadata. To import the DBD, right-click the Explorer Project (in this case, the
LGI Application), and select Import (Figure 8-19).
306
8174ch07.fm
Select the IMS Resources option, and click Next. See Figure 8-20.
307
8174ch07.fm
In Figure 8-22, select a location from which the resources are to be imported. The location
can be a file on your local workstation, a file on a host in which you are connected, or an IMS
catalog. Then click Next.
308
8174ch07.fm
You can now select the files from the source that you want imported into your project.
Although there are separate radio buttons on this window for DBDs and PSBs, IMS Explorer
can identify the resources in the source file selected. It then lists them in the appropriate list in
this window. IMS Explorer also understands a file of JCL containing multiple DBDs, PSBs, or
a mixture of both, which simplifies the import process.
The first resources to be imported here are DBDs. Click Add DBD, shown in Figure 8-23.
309
8174ch07.fm
Select the file that contains the DBDs to be imported. See Figure 8-24. In this example,
multiple DBDs are in a JCL file which was previously downloaded to the local workstation.
IMS automatically filters out the JCL and imports each of the DBDs in the file.
Figure 8-24 Select the file that contains the resources to be imported
310
8174ch07.fm
The Import IMS Resources window shows the two DBDs (S2U1DBD and S2U1DXD) which
were in the single JCL file that was imported. Any of these DBDs can now be deleted from the
import list if wanted.
To add PSBs to this import, click Add PSB. See Figure 8-25.
Figure 8-25 Keep selecting more files until you are done
As with the DBDs, a single file can contain multiple PSBs, and possibly the JCL used to
generate them. IMS looks for each of the PSBs and DBDs in the file selected and adds each
of them to the import selection.
Select the file that contains the PSBs that you want to import, and click Open. See
Example 8-26.
311
8174ch07.fm
The Import IMS Resources window shows the two PSBs imported from the single file that
was selected. Any of these DBDs and PSBs can now be removed from the import list by
selecting Delete DBD and then by selecting Delete PSB.
The IMS Explorer also shows any DBDs that still need to be imported to satisfy the databases
referenced in the PSBs to be imported. In this example, the two PSBs reference only the
databases to be imported.
You are now ready to import these DBDs and PSBs into your project. As Figure 8-27 shows,
click Finish.
312
8174ch07.fm
The LGI Databases project now includes the DBDs and PSBs that you imported and several
other artifacts that are needed later. At any time, you can refer to this project to see the DBD
or PSB source which was imported. The project also includes the generated source for the
DBDs and PSBs. At this stage, however, the generated source is the same as the imported
source. The sources are the same because you did not yet add any of the metadata from the
COBOL copybooks or PL/I include members. You do that soon.
To see the current layout of a database, click the arrow at the left of the DBD, to expand the
list of DBDs in your project. See Figure 8-28.
313
8174ch07.fm
Figure 8-28 LGI Databases project, showing the DBD and PSB resources which are imported
You can now see the two DBDs which are imported into your project, S2U1DBD.dbd and
S2U1DXD.dbd. Double-click the S2U1DBD.dbd option, as shown in Figure 8-29, to see the
view of this database.
You can now see the graphical layout of the database, shown in Figure 8-30. The segments in
the S2U1DBD database are shown. The relationships between these segments, and the
fields defined to each of the segments, are also shown.
314
8174ch07.fm
From this window, you can import the rest of the metadata for this database into this IMS
Explorer project. To do this import, right-click the CUSTROOT segment in the graphical view,
and select Import COBOL or PL/I Data Structures. This action opens the window shown in
Figure 8-31.
315
8174ch07.fm
To select the file that contains the COBOL or PL/I definition for the segment, click Browse, as
shown in Figure 8-31.
Select the file that contains the COBOL or PL/I definition for the custroot (client) segment, and
click Open, as shown in Figure 8-32.
316
8174ch07.fm
Figure 8-32 Select the file that contains the Copybook or Include member
Figure 8-33 shows the window that displays when you select Open (see Figure 8-32).
Figure 8-33 shows the Import Data Structures window. This panel is where you identify the
data structure to be imported for a database segment.
Figure 8-33 Identify the data structure to be imported for a database segment
In the COBOL copybook you selected, there is only one definition layout. Click Add, as shown
in Figure 8-34, to add this structure as the metadata for the CUSTROOT segment.
Chapter 8. The IMS catalog
317
8174ch07.fm
From here, click Finish to import this segment layout into the database definition for the
CUSTROOT segment. Figure 8-35 shows the expanded definition for this segment in the
database.
Figure 8-35 Explorer database view, with imported metadata for one segment
The same process (right-click the segment, import the COBOL or PL/I copybook, click Add,
then Finish) is used to import the metadata for each of the other segments in the database.
Figure 8-36 shows the database layout with definitions for each of the segments in the
database. The asterisk at the left of the database name (*S2U1DBD.dbd), indicates that the
318
8174ch07.fm
database definition is not yet saved. Select File Save to save the enhanced database
definition to the LGI Database Project.
Figure 8-36 Explorer database view, with imported metadata for all segments
You captured the metadata for the layout of each of the segments in your database. If you
click the expand arrow for DBD Source and Generated Source in your project, the IMS
catalog-enabled DBD source files heading opens. Figure 8-37 shows the enhanced
definitions for the databases in your project.
319
8174ch07.fm
You captured the expanded metadata for these databases. A snippet of the expanded DBD
definition for this database is shown in Figure 8-38.
320