DataStudio Redbook
DataStudio Redbook
Paolo Bruni
Marichu Scanlon
ibm.com/redbooks
Redpaper
REDP-4717-00
Note: Before using this information and the product it supports, read the information in Notices on
page vii.
Contents
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
The team who wrote this paper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Now you can become a published author, too! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .x
Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .x
Stay connected to IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .x
Chapter 1. The IBM Data Studio V2.2.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Understanding the Data Studio packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Eclipse Workbench common terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.1 Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.2 Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.3 Perspectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.4 Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.5 Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.6 Wizards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.7 Task Launcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Installation, configuration, and setup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4.1 Connectivity and the JDBC driver selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4.2 Client setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4.3 DB2 for z/OS setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4.4 Unicode support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4.5 Setup for SQL and Java stored procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4.6 WLM application environments and procedures . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.4.7 Data Studio actual costs setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.4.8 Data Studio and JDBC driver selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.4.9 Java SDK used by Data Studio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.4.10 Overview of routine development with Data Studio . . . . . . . . . . . . . . . . . . . . . . 23
1.5 Navigating through the Data Studio workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.5.1 Task Launcher view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.5.2 Data Source Explorer view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.5.3 Administration Explorer view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
1.5.4 Data Project Explorer view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
1.5.5 Output view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
1.5.6 Editor view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Chapter 2. Developing stored procedures with Data Studio. . . . . . . . . . . . . . . . . . . . .
2.1 Getting started with Data Studio stored procedures development . . . . . . . . . . . . . . . .
2.1.1 Starting Data Studio for the first time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.2 Creating a connection profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.3 Editing the connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.4 Creating a Data Development Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.5 Creating SQL statements and scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Creating a new stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.1 Creating a new stored procedure using templates . . . . . . . . . . . . . . . . . . . . . . . .
2.2.2 Copying and pasting (or dragging and dropping) from the Data Source Explorer
Copyright IBM Corp. 2011. All rights reserved.
49
50
50
51
54
55
57
60
61
62
iii
63
63
63
64
65
65
69
71
71
72
74
77
78
78
80
80
80
81
82
iv
115
116
116
118
119
119
125
126
127
128
135
136
137
138
149
149
149
150
151
Contents
vi
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries. Consult
your local IBM representative for information on the products and services currently available in your area.
Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product, program, or service that does
not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to
evaluate and verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this document. The
furnishing of this document does not give you any license to these patents. You can send license inquiries, in
writing, to:
IBM Director of Licensing, IBM Corporation, North Castle Drive, Armonk, NY 10504-1785 U.S.A.
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of
express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically made
to the information herein; these changes will be incorporated in new editions of the publication. IBM may make
improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time
without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in any
manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the
materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products and cannot confirm the
accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the
capabilities of non-IBM products should be addressed to the suppliers of those products.
This information contains examples of data and reports used in daily business operations. To illustrate them
as completely as possible, the examples include the names of individuals, companies, brands, and products.
All of these names are fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrate programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs in
any form without payment to IBM, for the purposes of developing, using, marketing or distributing application
programs conforming to the application programming interface for the operating platform for which the sample
programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore,
cannot guarantee or imply reliability, serviceability, or function of these programs.
vii
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines
Corporation in the United States, other countries, or both. These and other IBM trademarked terms are
marked on their first occurrence in this information with the appropriate symbol ( or ), indicating US
registered or common law trademarks owned by IBM at the time this information was published. Such
trademarks may also be registered or common law trademarks in other countries. A current list of IBM
trademarks is available on the Web at http://www.ibm.com/legal/copytrade.shtml
The following terms are trademarks of the International Business Machines Corporation in the United States,
other countries, or both:
AIX
DataPower
DB2 Connect
DB2
developerWorks
DRDA
IBM
ILOG
Informix
InfoSphere
iSeries
Language Environment
MVS
Optim
OS/390
Passport Advantage
pureScale
QMF
Query Management Facility
RACF
Rational
Redbooks
Redpaper
Redbooks (logo)
System z
System/390
WebSphere
z/OS
viii
Preface
Stored procedures can provide major benefits in the areas of application performance, code
re-use, security, and integrity. DB2 has offered ever-improving support for developing and
operating stored procedures.
This IBM Redpaper publication is devoted to tools that can be used for accelerating the
development and debugging process, in particular to the stored procedure support provided
by the latest and fastest evolving IBM product: Data Studio.
We discuss topics related to handling stored procedures across different platforms. We
concentrate on how to use tools for deployment of stored procedures on z/OS, but most
considerations apply to the other members of the DB2 family.
This paper is a major update of Part 6, Cool tools for an easier life, of the IBM Redbooks
publication DB2 9 for z/OS Stored Procedures: Through the CALL and Beyond, SG24-7604.
ix
Comments welcome
Your comments are important to us!
We want our papers to be as helpful as possible. Send us your comments about this paper or
other IBM Redbooks publications in one of the following ways:
Use the online Contact us review Redbooks form found at:
ibm.com/redbooks
Send your comments in an email to:
[email protected]
Mail your comments to:
IBM Corporation, International Technical Support Organization
Dept. HYTD Mail Station P099
2455 South Road
Poughkeepsie, NY 12601-5400
Chapter 1.
Introduction
Understanding the Data Studio packaging
Eclipse Workbench common terminology
Installation, configuration, and setup
Navigating through the Data Studio workspace
1.1 Introduction
In DB2 V7.2 for Linux, UNIX, and Windows, IBM introduced tooling support for stored
procedures via the Stored Procedure Builder product. IBM enhanced this tooling with the
follow-on tool, Development Center, in DB2 V8.1 for Linux, UNIX, and Windows. With DB2 9
for Linux, UNIX, and Windows, the Developer Workbench was introduced. Developer
Workbench is based on Eclipse technology. The stored procedure tooling for DB2 databases
is also consistent with the tooling delivered in WebSphere Application Developer and
Rational Application Developer. On October 30, 2007, IBM announced Data Studio, which
builds upon the tooling support of Developer Workbench and other IBM tooling products.
As of the publication of this paper, there are three products referred to as Data Studio
(Table 1-1).
Table 1-1 Data Studio products
Product
COMPID
5724-DST00
5724-DST04
5724-DST01
Data Studio is a comprehensive data management solution that empowers you to effectively
design, develop, deploy, and manage your data, databases, and database applications
throughout the entire application development life cycle utilizing a consistent and integrated
user interface. Included in this tooling suite are the tools for developing and deploying DB2 for
z/OS stored procedures. Unlike Development Center, which was included in the DB2 V8.1 for
Linux, UNIX, and Windows Application Development Client (ADC) component, Data Studio is
independent of any other product offering and does not require a DB2 client to be installed.
A description of the supported products that can shell-share with Data Studio or Optim
Development Studio is provided in the technote Shell sharing with InfoSphere Data
Architect, Optim Development Studio, and Optim Database Administrator available from:
http://www.ibm.com/developerworks/data/library/techarticle/dm-0811khatri/index.htm
l?ca=drsData Studio supports the entire family of DB2 servers, as well as Informix. Support for the
Oracle data server is available in Optim Development Studio.
The latest version, Data Studio V2.2.1, supports:
The suite of servers and functions that the Data Studio products support are summarized in
Table A-1 on page 136 and Table A-2 on page 137.
For more information about Data Studio, see:
http://www.ibm.com/support/entry/portal/Overview/Software/Information_Management/I
BM_Data_Studio
Workspace
Resources
Perspectives
Views
Editors
Wizards
Task Launcher
1.3.1 Workspace
When you open the Workbench, you are asked to choose a workspace. All your resources
and settings are saved in this workspace. Only one workspace is active at any given time.
You can open a different workspace each time that you open the Workbench. You can also
switch workspaces by clicking File Switch Workspace.
1.3.2 Resources
A resource is a collective term for the projects, folders, and files that you created in a
workspace. Typically, resources are viewed in a hierarchical format and can be opened for
editing. There are three basic types of resources that exist in the Workbench:
Files
A file in Eclipse is comparable to files in the workstation. Each resource in Eclipse is
associated with a file. Eclipse persists or saves all resources in the workspace as files in
the file system.
Folders
Folders in the Eclipse workspace are comparable to directories in a file system. In the
workspace, folders are containers for the various resources that can be created, viewed,
or manipulated by the tooling.
Projects
In Eclipse, development is contained in projects. Projects contain folders, which in turn
can contain either a set of objects or another folder. Projects have one or more nature
associated with them, meaning that the contents and tasks that can be done on the
objects within the project depend on the kind of project created.
A project is either open or closed. When a project is closed, it cannot be changed in the
Workbench. The resources of a closed project do not appear in the Workbench, but the
resources still reside on the local file system. When a project is open, the structure and
contents of the project can be viewed and modified.
1.3.3 Perspectives
A perspective is a group of views and editors in the Workbench window. One or more
perspectives can exist in a single Workbench window. Each perspective contains one or
more views and editors. Each perspective can have a different set of views, but all
perspectives share the same set of editors.
Data perspective
The Data perspective is the default perspective for Data Studio IDE. The Data perspective
provides a set of functions and specialized views for displaying, creating, deploying, and
managing application development objects and database objects.
Debug perspective
The Debug perspective is the primary perspective used by Data Studio when debugging an
SQL or Java stored procedure. This perspective is used by other products, such as the
Rational Developer V7 for System z.
Java perspective
The Java perspective is the primary perspective used by Data Studio when developing
pureQuery applications. This perspective is also by other products, such as the Rational
Application Developer.
Other perspectives used by Data Studio are the Team Perspective and the Resource
Perspective.
1.3.4 Views
A view is a visual component within the Workbench that is used to display a hierarchy of
resources in the Workbench, display properties of a resource, and perform tasks on the
resource. Modifications made in a view are saved immediately. Only one instance of a
particular type of view can exist within a Workbench window.
In any of the perspectives you can:
Several views can share an area of the workspace as in the case when multiple objects are
opened in the Editor. The Output view also shows multiple types of output (for example, error
log, problems, data output, and so on).
The views used by a database application developer differ slightly from the views used by a
database administration developer. Commonly used views are the Data Source Explorer,
Data Project Explorer, Administration Explorer, and Data Output views. More information
about these views in Data Studio is given in 1.5, Navigating through the Data Studio
workspace on page 26.
1.3.5 Editors
An editor is a visual component within the Workbench that is used to edit or browse a
resource. Modifications made in the editor follow an open-save-close lifecycle model. An
editor can be specialized for a function. Multiple instances of specialized editors can exist
within a Workbench window.
1.3.6 Wizards
A wizard is a visual component within the Workbench that is used to step a user through a
series of tasks related to a resource. The purpose of the wizard is to make a task easy for
the user.
The driver significance pertains to the set of information regarding the JDBC driver being used.
10.Verify that the disk space that you have can accommodate the installation size.
Click Install.
11.Check for a success message, then click Finish.
Shell share: Data Studio IDE and Optim Development Studio can share a package group
with other compatible products that have been installed with IBM Installation Manager. So
in step 7 on page 7, you can opt to install the same package group or to create a new one.
You can also opt to extend the Eclipse IDE you currently installed in your system. Several
InfoSphere products, Optim or Rational, include the Eclipse IDE in their installation. You
can significantly reduce your storage requirements if you opt to shell share or share the
base Eclipse plug-ins of these products with Data Studio.
The technote Information about which IBM Software products can be installed together so
together so that they share a common environment lists the compatible products that can
shell-share with Data Studio. It is available from:
http://www.ibm.com/support/docview.wss?rs=2042&uid=swg21279139
Data Studio is installed into two default directories:
C:\Program Files\IBM\SDPShared
C:\Program Files\IBM\Data Studio
Also called, the IBM Universal Driver for JDBC and SQLJ
set
CLASSPATH=c:\Progra~1\IBM\sqllib\java\db2jcc.jar;c:\Progra~1\IBM\sqllib\java\db2jc
c_license_cisuz.jar;c:\Progra~1\IBM\sqllib\java\db2jcc_license_cu.jar;%$CLASSPATH%
java com.ibm.db2.jcc.DB2Binder -url jdbc:db2://utec730.vmec.svl.ibm.com:446/STLEC1
-user ADMF001 -password C0DESHOP -collection DSNJDBC
cd C:\Progra~1\IBM\SQLLIB\bnd
db2 connect to EC730V10 user ADMF001 using C0DESHOP
db2 bind @ddcsmvs.lst BLOCKING ALL SQLERROR CONTINUE GRANT PUBLIC
db2 connect reset
In Example 1-2, -url points to the domain:port//location of the DB2 for z/OS server that you
want to connect to. The user is the TSO logon ID, and password is the TSO logon ID
password. The bind might need to be repeated after applying a FixPak to Data Studio. If the
DB2Binder is not run, and you do not re-execute the bind, you receive -805 at the workstation
when trying to connect to the server from Data Studio.
Note: Both the location and collection IDs should be in uppercase when submitting the
DB2Binder command from the client. To continue typing a long line to the next line, type a
backslash (\), followed by a space, then continue typing on the next line.
Language Environment
Workload Manager
Resource Recovery Services
REXX language
Unicode support
DSNTIJTM
DSNTIJMS
DSNTEJ6W
DSNTIJSG
DSNTIJCC
CONNECT
CREATE PROCEDURE
Also requires one of the following privileges:
SYSADM or DBADM.
CREATEIN for the schema if the schema name of the stored
procedure refers to an existing schema.
IMPLICIT_SCHEMA authority on the database if the implicit or
explicit schema name of the stored procedure does not exist.
IMPLICIT_SCHEMA allows you to implicitly create an object with a
CREATE statement and specify a schema name that does not
already exist. SYSIBM becomes the owner of the implicitly created
schema, and PUBLIC is given the privilege to create objects in
this schema.
CREATE IN privilege on desired collection ID.
SELECT
SELECT
SELECT
UPDATE
UPDATE
DELETE
DEBUGSESSION
You must have ownership of the stored procedure and at least one of
the following:
DELETE privilege
DROPIN privilege for the schema or all schemas
SYSADM or SYSCTRL authority
You must have ownership of the stored procedure and at least one of
the following:
UPDATE privilege
ALTERIN privilege for the schema or all schemas
SYSADM or SYSCTRL authority
10
SYSIBM.SYSCOLAUTH
SYSIBM.SYSCOLUMNS
SYSIBM.SYSDATABASE
SYSIBM.SYSDBAUTH
SYSIBM.SYSINDEXES
SYSIBM.SYSJAROBJECTS
SYSIBM.SYSPACKAGE
SYSIBM.SYSPACKAUTH
SYSIBM.SYSPACKDEP
SYSIBM.SYSPARMS
SYSIBM.SYSPLAN
SYSIBM.SYSPLANAUTH
SYSIBM.SYSRESAUTH
SYSIBM.SYSROUTINEAUTH
SYSIBM.SYSROUTINES
SYSIBM.SYSSCHEMAAUTH
SYSIBM.SYSSYNONYMS
SYSIBM.SYSTABAUTH
SYSIBM.SYSTABLES
SYSIBM.SYSUSERAUTH
SYSIBM.SYSVIEWS
Data Studio also accesses the catalog and non-catalog tables listed in Table 1-4 when
creating external SQL stored procedures.
Table 1-4 DB2 system catalog tables accessed when creating SQL stored procedures
SELECT privilege on:
SYSIBM.SYSDUMMY1
SYSIBM.SYSROUTINES
SYSIBM.SYSPARMS
SELECT, INSERT,
UPDATE, and DELETE
privilege on:
SYSIBM.SYSROUTINES_SRC
SYSIBM.SYSROUTINES_OPTS
SYSIBM.SYSPSM
SYSIBM.SYSPSMOPTS
SYSIBM.SYSPSMOUT
11
Data Studio accesses the catalog tables listed in Table 1-5 when creating JAVA stored
procedures.
Table 1-5 DB2 system catalog tables accessed when creating Java stored procedures
SELECT privilege on:
SYSIBM.SYSROUTINES
SYSIBM.SYSDUMMY1
SYSIBM.SYSPARMS
SYSIBM.SYSJARCONTENTS
SYSIBM.SYSJAROBJECTS
SYSIBM.SYSJAVAOPTS
The user connecting to DB2 for z/OS must hold privileges listed in Table 1-3 on page 11 and
Table 1-4 on page 11 for SQL stored procedures, and Table 1-5 for Java stored procedures.
Without Unicode Conversion Services set up, you can initially create, view, and modify a Java
stored procedure. However, restoring the source from the database of a previously created
Java stored procedure returns the source as a single line with red blocks interspersed, which
represent line feeds that have not been translated correctly. The Data Studio support for SQL
stored procedures handles the code conversion, and UCS is not required.
12
Description
SYSPROC.DBG_%MANAGER
DSNTPSMP
Procedure name
Description
SYSPROC.SQL%
SQLJ.DB2_%_JAR
SQLJ.DB2_UPDATE_JARINFO
SQLJ.ALTER_JAVA_PATH
WLM_REFRESHa
a. This stored procedure requires RACF permissions using an authorization ID that has MVS
command authority.
Additionally, the RACF class DSNR needs to be activated prior to calling this stored
procedure. This is done using the RACF panels listed in Table 1-7.
Table 1-7 Activate class DSNR
RACF panel
Option to select
5.
3.
13
;|-CCNDRVR--|
;|-CBC320PP-|
;'-EDCDC120-'
;-THE NAME OF THE C COMPILER TO USE. ADJUSTMENT OR ADDITIONAL
;-CONFIGURATION OF THE WLM ENVIRONMENT IS USUALLY REQUIRED
;-WHEN CHANGING THE C COMPILER.
;VALIDATE_BIND = DEFAULT
;- DEFAULT, PERMIT, ENFORCE
;-SPECIFIES INSTALLATION CONTROL FOR ALL BUILDS OVER THE
;-USAGE OF THE BIND PACKAGE OPTION VALIDATE(BIND). CHANGING
;-THE DEFAULT MAY PROVIDE A PERFORMANCE IMPROVEMENT.
ISOLATION_DEFAULT = CS
;CS OR RR
;-SPECIFIES INSTALLATION CONTROL OVER THE DEFAULT VALUE FOR
;-THE BIND PACKAGE OPTION ISOLATION. CHANGING THE DEFAULT
;-MAY PROVIDE A PERFORMANCE IMPROVEMENT.
;
CURRENTDATA_DEFAULT = YES
;-SPECIFIES INSTALLATION CONTROL OVER THE DEFAULT VALUE FOR
;-THE BIND PACKAGE OPTION CURRENTDATA. CHANGING THE DEFAULT
;-MAY PROVIDE A PERFORMANCE IMPROVEMENT.
;
DSNTPSMP_TRACELEVEL= LOW
;- OFF, LOW, MEDIUM, HIGH
;-CONTROLS THE LEVEL OF DSNTPSMP TRACE DATA WRITTEN OUT TO
;-THE DD:SYSTSPRT DATASET IN THE WLM ADDRESS SPACE. SETTING
;-THE VALUE TO OFF WILL MINIMIZE, NOT ELIMINATE, LOG RECORDS
;-WRITTEN TO DD:SYSTSPRT IN THE WLM-SPAS.
;
14
LRECL
255
RECFM
VB
ORGANIZATION
PS
Example 1-4 shows an example of the contents of the JAVAENV data set.
Example 1-4 Contents of JAVAENV - DB9AU.JAVAENV file
ENVAR("JAVA_HOME=/usr/lpp/java/J5.0",
"JCC_HOME=/usr/lpp/db2/db9a/db2910_jdbc",
"CLASSPATH=/usr/lpp/db2/db9a/db2910_jdbc/userproc",
"DB2_BASE=/usr/lpp/db2/db9a/db2910_base",
"RESET_FREQ=-1"),
XPLINK(ON)
All the environment variables need to be included in this file. Ensure that the total length of
all the entries does not exceed 245 bytes (exclude the blanks)3. In case your entries
exceed the 245-byte limit, you need to take a different approach. Example 1-5 shows an
alternate form of JAVAENV definitions.
Example 1-5 Contents of JAVAENV having _CEE_ENVFILE variable
ENVAR("_CEE_ENVFILE=/usr/lpp/db2/db9a/evnfile.txt",
"JAVA_HOME=/usr/lpp/java/J5.0",
"DB2_BASE=/usr/lpp/db2/db9a/db2910_base",
"RESET_FREQ=-1"),
XPLINK(ON)
The _CEE_ENVFILE variable points to an HFS file that contains most of the environment
variables, because this file has no limitation of size. The JAVA_HOME variable must be
defined in the JAVAENV data set, and not in the HFS file corresponding to _CEE_ENVFILE.
Example 1-6 shows the contents of the _CEE_ENVFILE file. This is a standard UNIX file
where each line must start in column 1 and the continuation character is a backslash (\).
Example 1-6 Contents of the _CEE_ENVFILE - /usr/lpp/db2/db9a/envfile.txt
JCC_HOME=/usr/lpp/db2/db9a/db2910_jdbc
CLASSPATH=/usr/lpp/db2/db9a/db2910_jdbc/userproc
You can use _CEE_ENVFILE to overcome the 245-byte limit when specifying other
environmental variables that tend to be long or transitory in nature, such as
JITC_COMPILING and JITC_COMPILEOPT.
Environment variable
Description
JCC_HOMEa
JAVA_HOME
DB2_BASE
15
Environment variable
Description
CLASSPATH
JVMPROPS
Here you can optionally specify the name of a USS file that contains
JVM startup options. See JVMPROPS on page 190.
RESET_FREQ
HEAP
WORK_DIR
a. If the DB2_HOME environment variable is coded in the JAVAENV data set, DB2 for z/OS V8
ignores this. However, in DB2 9 for z/OS, this causes an error when the WLM is started.
Heap size: When using JVM 1.4.2, the default native heap size is insufficient for
debugging Java stored procedures with the IBM Data Studio. The JVM 1.5 and 1.6 default
native heap size is sufficient. The JDK1.4.2 heap size therefore has to be increased to
(8M,2M,ANYWHERE,KEEP). Do not put this environment variable in the _CEE_ENVFILE.
For example, in your JAVAENV file, you can code:
MSGFILE(JSPDEBUG,,,,ENQ),
XPLINK(ON),
HEAP(8M,2M,ANYWHERE,KEEP),
ENVAR("_CEE_ENVFILE=/u/oeusr05/CEEOPTIONS.txt")
DB2 9 and 10 for z/OS flag the presence of the environment variable DB2_HOME as an
error. DB2 for z/OS V8 ignores this variable.
JVMPROPS
JVMPROPS is the environment variable that specifies the name of a z/OS UNIX System
Services file that contains startup options for the JVM in which the stored procedure runs.
JVMPROPS is the Java stored procedures environment mechanism to set the
-Xoptionsfile option.
Example 1-7 shows the contents of the HFS file.
Example 1-7 Contents of the JVMPROPS file
16
For information about JVM startup options, see the BM 31-bit and 64-bit SDKs for z/OS, Java
2 Technology Edition, Version 5 SDK and Runtime Environment User Guide, available at:
http://www.ibm.com/servers/eserver/zseries/software/java/pdf/sdkguide.zos.pdf
Note: To enable class sharing in JDK 1.5, code the -Xshareclasses option in this file.
WLM
procedure
name
Description/usage
DSNWLM_GENERAL
DSNWLMG
DSNWLM_JAVA
DSNWLMJ
DSNWLM_DEBUGGER
DSNWLMD
DSNWLM_PGM_CONTROL
DSNWLMP
DSNWLM_REXX
DSNWLMR
DSNWLM_XML
DSNWLMX
17
18
When deploying a new SQL or Java stored procedure using the Deploy wizard, a different
build schema and utility (external SQL only) can be selected from the Routine options
page Deploy Options tab Build utility field (Figure 1-2).
CPU time
Latch/lock wait time
Getpages
Read I/Os
Write I/Os
The installation job DSNTIJRT installs and configures DSNWSPM. A final setup step for
actual costs is to ensure that the DB2 accounting trace is running. If it is not, issue the
following command to start it:
-START TRACE(ACCTG) CLASS(1,2,3)
19
20
The Driver significance pertains to the set of information regarding the JDBC driver being used.
Data Studio IDE ships with a JDK 1.6 library. This is the default JDK used when developing
Java stored procedures and applications. The JDK is found in <Data Studio install
directory>\jdk.
Data Studio stand-alone does not ship any JDK, as Java development is not available in the
stand-alone version. However, a Java Runtime Environment is shipped with Data Studio
stand-alone in <Data Studio stand-alone directory>\jre, which allows Java stored
procedures and applications to execute.
The user can opt to compile with a lower-level JDK by setting the JDK level in three places:
In the workspace Preferences
In the Projects Properties
In the stored procedures Deploy options
21
DB2 10 for z/OS supports JDK 1.4 or later. JDBC 4.0 functions require Java Technology
Edition V6 (JDK 1.6) or later.
When using JDK 1.4.1 or later, the XPLINK(ON) parameter is required in the //JAVAENV DD
statement. When the XPLINK(ON) parameter is not included in a //JAVAENV DD statement
that specifies JDK 1.4.1, the WLM SPAS does not initialize and the following error message is
included in the WLM SPAS joblog:
+DSNX961I DSNX9WLJ ATTEMPT TO PERFORM JNI FUNCTION CreateJavaVM 421
FAILED FOR STORED PROCEDURE . . SSN= DB8A
PROC= DB8AJAV1 ASID=
008E CLASS= METHOD= ERROR INFO= DSNX9WLS ESTAE ENTERED
If JSPDEBUG is turned on in the same //JAVAENV DD statement, information like the
following is also included, indicating that a call was made from a NOXPLINK-compiled
application to an XPLINK-compiled exported function in DLL libjvm.so, and the XPLINK(ON)
runtime option was not specified:
CEE3501S The module libjvm.so was not found.
From entry point initjvm at compile unit offset +000014A0 at entry off
XPLINK(ON),
ENVAR("JCC_HOME=usr/lpp/db2a10/jdbc/",
"JAVA_HOME=/usr/lpp/java/IBM/J1.4"),
MSGFILE(JSPDEBUG,,,,ENQ)
22
2
Create a new data
development project
associated with DB9A
connection
3
Create and develop stored procedures
using wizards:
New stored procedure
New Version
New Package Variation
Deploy
Import
Export
Data Studio creates external SQL and Java stored procedures on z/OS using multiple
DB2-supplied stored procedures. The main DB2-supplied stored procedures that perform the
processing on z/OS for Data Studio are:
When connected to DB2 10 for z/OS, Data Studio can create both external SQL stored
procedures and Native stored procedures that no longer require DSNTPSMP. The tooling
identifies the type of SQL stored procedure by appending (external) or (native) to the
stored procedure name displayed in the Data Project Explorer.
23
Name
Function
Basic
BUILD
ALTER
REBIND
DESTROY
REBUILD
ALTER_REBIND
ALTER_REBUILD
REBUILD_DEBUG
ALTER_REBUILD_DEBUG
QUERYLEVEL
Modify
Identification
Figure 1-5 describes how the Data Studio creates SQL stored procedures on z/OS.
DSNTPSMP
z/OS REXX
stored procedure
for processing
external SQL
stored procedures
SQL precompile
Performs
C compile
C compile and prelink
Link
Deploy
PROCEDURE definition
1-4
24
BIND PACKAGE
CREATE PROCEDURE
Save options and source
in DB2 catalog
The steps performed by Data Studio to create external SQL stored procedures are:
1. Launch Data Studio and select a workspace.
2. Create a connection or reconnect to an existing connection to a DB2 server.
3. Create a Data Development Project and set the target connection to the above database
server.
4. Create a new SQL stored procedure using the New Stored Procedure wizard. This is
a one-page wizard that presents the user with a choice of templates for the new
stored procedure.
5. After the stored procedure has been created and edited, the user can choose to deploy
the stored procedure using the Deploy wizard.
6. The Deploy wizard calls the DB2-supplied stored procedure, DSNTPSMP.
7. DSNTPSMP performs the following steps to create the SQL stored procedure on z/OS:
a.
b.
c.
d.
e.
f.
g.
SQL precompile
C precompile
C compile and prelink
Link
Bind package
Registers procedure in the DB2 catalog
Saves options
CALL
SQLJ.DB2_INSTALLJAR
Deploy
5
CREATE PROCEDURE
Call SQLJ.
DB2_UPDATEJARINFO
6
1
25
The steps performed by Data Studio to create Java stored procedures are:
1. As in SQL stored procedures, use the New Stored Procedure wizard to create a Java
stored procedure. Data Studio generates both the DDL and the Java source.
2. Deploy the stored procedure.
For Java stored procedures using dynamic (JDBC) SQL, Data Studio issues javac to
compile the stored procedure.
For Java stored procedures using static (SQLJ) SQL, Data Studio issues sqlj to translate
and compile the stored procedure.
Data Studio also issues db2sqljcustomize, which:
Updates the .ser file created in step 2
Optionally binds the stored procedure
3. Then Data Studio issues a jar command to jar the .ser, .class, and optionally the
.java files.
4. Data Studio calls SQLJ.DB2_INSTALL_JAR to install the jar in the server or
SQLJ.DB2_REPLACE_JAR to replace the jar when the stored procedure already exists in
the server.
5. Data Studio issues the CREATE PROCEDURE DDL to register the stored procedure into
the catalog.
6. Data Studio calls SQLJ.DB2_UPDATEJARINFO to copy the Java source into the catalog.
26
27
In addition to viewing the stored procedures and UDFs that are on the server, the Data
Source Explorer allows you to view and work with other database objects such as tables,
triggers, views, and so on.
28
In addition to the above icons, there is a pull-down menu in the toolbar for additional tasks
such as Monitor events and Customize view (Figure 1-9).
In Using the SQL and XQuery Editor on page 59, we discuss the Connection Wizard and
the SQL Editor in detail.
29
New
Alternatively to filter, you can select New. This action creates a new stored procedure
using the SQL Editor. You can only create a new SQL Procedure using this action.
Right-click the Stored Procedures folder and click New With SQL Editor to create a
blank editor in the Editor view. You can type your CREATE PROCEDURE statement
there. See Using the SQL and XQuery Editor on page 59 for details about how to use the
SQL Editor.
30
Refresh
This action reloads the latest information for the specific folder, in this case, stored
procedures, from the server catalog. Right-click the Stored Procedures folder and click
Refresh to refresh the list of deployed or cataloged stored procedures.
Deploy
This action launches the Deploy wizard. Right-click the Stored Procedures folder and
click Deploy to redeploy one, some, or all the stored procedures listed in this folder. If you
expand the Stored Procedures folder, you can deploy one or mores stored procedures as
well. Right-clicking a specific stored procedure and then clicking Deploy allows you to
redeploy only the selected stored procedure. Pressing Ctrl and clicking several stored
procedures and then right-clicking Deploy allows you to redeploy the selected stored
procedures. Figure 1-11 shows the first page of the Deploy wizard. Details on the Deploy
wizard are discussed in 2.5, Deploying a stored procedure on page 71.
31
The context menu for a specific stored procedure shows additional actions that can be
taken on the stored procedure. Right-click the stored procedure to see a menu with the
following options:
Run and Run Settings
These two actions execute the selected stored procedure. Run Settings allows you to
preset parameters and execute SQL statements before and after calling the stored
procedure.
Open with SQL Editor
This action launches the SQL Editor on the Editor view. Data Studio assumes that you
are opening the stored procedure for editing. To save your changes, specify a Data
Development Project to contain the modified stored procedure.
Debug
This action is grayed out if the stored procedure is not enabled for debugging.
Drop
This action issues a DROP PROCEDURE against the selected stored procedure. A
confirmation dialog is displayed before the action is sent to the server.
Note: This action drops all versions of a Native SQL Stored procedure. To drop a
specific version, expand the selected stored procedure and click Versions, then
select the specific version and activate the Drop action from this version.
Generate DDL
This action launches the Generate DDL wizard. In the wizard, you can:
Optional: Generate any GRANT statements based on the current privileges held on
this stored procedure.
Execute the generated DDL, or save and edit the generated script. You are asked
to specify an existing project to contain the generated script. Data Studio looks at
the list of existing projects and defaults the project to one that is using the current
server or one that is a best fit (that is, same operating system, same version).
Note: For Java stored procedures, Generate DDL does not create a clone of the
Java source associated with the Java stored procedure.
32
Figure 1-12 shows the DDL generated for one of our sample stored procedures.
Analyze Impact
This action examines the SYSROUTINESDEP and SYSPACKAGEDEP catalogs and
lists the objects that have dependencies on this stored procedure.
New version
This action is only available when the selected stored procedure is a Native SQL
stored procedure. This action launches the New Version wizard. This wizard creates a
new version of the selected stored procedure and optionally deploys it.
Refresh
This action queries the server catalogs and displays all stored procedures in the
schema. If the folder is filtered, the filter is applied to the refresh action.
Query Tuner
This action launches several sub-actions related to single-query tuning. The target
database needs to be configured for tuning either explicitly from the Configure for
Tuning menu sub-action or implicitly when you try to Start tuning. We discuss the query
tuner support in 3.1, Additional features in Data Studio on page 86.
33
Deploy
This is the same action as in the stored procedure executed against a specific stored
procedure.
Open Visual Explain
This action browses a SQL stored procedure source for the first SQL Statement and
attempts to explain the statement. This action is not available for Java stored
procedures. Also, this action assumes that the server is configured for
single-statement query tuning.
Copy
This action creates a clone of the stored procedure model. The corresponding Paste
action should be done against a Data Development Projects stored procedure folder.
Properties
This action displays and organizes the stored procedures properties in tabbed pages
in the Property Browser.
Generate pureQuery Code (Optim Development Studio only)
This action allows you to generate the pureQuery code to call this stored procedure.
You need to have an existing Java project and an existing Java program where the
pureQuery code is embedded. PureQuery is beyond the scope of this book. However,
see 3.2, Additional features in Optim Development Studio on page 107, for an
overview of Data Studios pureQuery support.
Details on the above actions are discussed in 2.1, Getting started with Data Studio stored
procedures development on page 50.
34
In the Administration Explorer, against a DB2 for z/OS connection, the subsystem folder
expands to a list of object types (a folder) found in the server. In the Administration Explorer,
you can do the following types of administration tasks5:
Manage the connection to the entire subsystem.
For each object type folder (a flat folder), you can create a new object of that type.
When you click an object type in the Administration Explorer, a list of objects is displayed
in the Object Editor.
In the Object Editor, you can do the following types of administration tasks:
Alter, drop, and copy.
Generate DDL.
Manage privileges.
Analyze impact.
Add the object to an Overview diagram.
5
Not all tasks can be performed on all the objects. See Table A-3 on page 139 for specific tasks that you can perform
against a specific object.
35
For tables, materialized query tables (MQTs), synonyms and views, unload and edit
data using the Object Data Editor.
For tables only, Load data.
36
Each Data Development Project contains the database objects that you can work on, in an
object tree structure. Figure 1-15 shows the contents of a Data Development Project.
37
Project properties
A set of project properties associated with the Data Development Project can be used to set
default values when creating objects within the project. Right-click the project name and
select Properties to launch the Properties dialog.
The Database Connection page displays the connection properties of the target
connection. In 2.1.2, Creating a connection profile on page 51, we discuss how to set the
connection properties. This page also allows you to set the current schema (Figure 1-16).
A discussion of the current schema versus current SQLID is provided in 2.5.1, The
Deploy wizard on page 71.
38
The Routine Development page allows you to set the JDK level to be used for compiling
the Java stored procedures that you create. Additionally, you can set the package owner
and build owner for SQL and SQLJ stored procedures on this page (Figure 1-17). Both the
package and build owner can be set to secondary authorization IDs.
39
Properties view
In the Data Source Explorer, when a specific object is selected, the properties of the object
are retrieved and displayed on the Output views Properties tab (Figure 1-18).
The Properties tab, in turn, contains multiple tabs that group the stored procedures attributes
into:
General
Name
Label (on)
Result sets returned
Language
Parameter style
External name
Deterministic/Non Deterministic
Parameters
Parameter type
IN
OUT
INOUT
Parameter name
Parameter data type
SQL or Java source
Privileges
Grantee
Grantee type, privilege, Grantor, with grant option
Procedure options
40
Specific name
Package ID, data access type
Collection ID
ASUTIME
External Security
Stay Resident
Program Type
Commit on Return
Build options
WLM Environment
Build Utility
Build Owner
Precompile
Compile
Prelink
Link
Bind options
Documentation: The text supplied in the Comment on statement for this stored procedure
is displayed here
The fields in the Property Browser are READ-ONLY. To modify an SQL or Java stored
procedure, you need to open the procedure with the SQL Editor, then redeploy it.
Also, the Package and Statistics tabs are not used. To view the package information related
to a specific stored procedure, expand the Packages folder for this schema and select the
associated package ID from the list. The Properties tab is refreshed with the package
information.
41
The Status History pane displays individual actions or a group of actions (as in when a SQL
script is executed). When a specific action in the Status History pane is selected, the Current
Output pane is populated with the output details.
In the Current Output pane, you can select different tabs to view different kinds of output:
The Status tab displays the overall status of the action.
The Parameters tab displays the name and values of the parameters after a stored
procedure is executed. This tab is only shown when the action is run or debug of a routine.
The Results tab displays the result sets of an action. This tab is only shown if an action
returns one or more result sets. Each result set is a separate tab.
You can remove an entry or all entries from the Status History list by right-clicking the action
and clicking Remove or Remove All.
Problem view
The Problem view displays a list of errors and warnings encountered when building a project
and is automatically launched when errors are detected. You can click each error and
examine the error details of the error. Double-click the message to locate the error in your
Java source.
The Filter button lets you configure the view. You can filter by element, such as the class that
you are editing or the working set, the type of problem (such as. java problems, buildfile
problems, and so on), and severity.
42
You can manage the entire log or an entry in the Error Log through the context menu actions
(Figure 1-20).
43
Use this editor for viewing and changing the source code and configuration options of a
stored procedure that you are working on in the Data Project Explorer. Figure 1-21 and
Figure 1-22 on page 45 show the contents of the Routine Editors Java and DDL tabs for a
Java stored procedure. SQL stored procedures have only one tab, DDL.
The Routine Editors DDL tab is a rich editor that supports cut, copy, paste, find and replace,
menu and keyboard shortcuts, and syntax highlighting. You can change the default look and
feel of this page in the Preferences. See 2.1.1, Starting Data Studio for the first time on
page 50.
To edit the DDL of an SQL stored procedure:
1. In the Data Project Explorer, right-click the routine that you want to modify and click Open.
The routine DDL displays in the Routine Editor view.
2. Edit the DDL. You can:
Change or add SQL statements directly in the editor.
Press Ctrl+Space bar to launch Content Assist.
3. To save your changes, you can:
Click File Save Object or File Save All.
Click the Save icon (floppy disk image) or press Ctrl+S.
For Java stored procedures, the Routine Editor contains a second tab, the Java tab. The Java
source of the Java stored procedure is displayed here. It is also editable. Certain changes to
the Java source can impact the DDL. Data Studio V2.2.1 attempts to synchronize changes in
the Java source with the DDL, but not vice versa. When the modified Java source is saved,
Data Studio requests the user to select a method to synchronize with. Click Sync to complete
this action.
After saving your changes, Data Studio replaces the persisted resource corresponding to this
stored procedure in the workspace. However, to replace the object in the server, you need to
44
deploy or redeploy the stored procedure. Depending on your deploy options, Data Studio
either drops the old routine from the database and creates a routine that reflects the changes
that you made or it alters it. Changes to the SQL procedure body rarely cause the procedure
to be dropped. Where possible, changes to the source code of SQL stored procedures result
in an ALTER command rather than a DROP command.
Finally, the Routine Editor is also used by the Debug Perspective when debugging
SQL routines.
Java Editor
The Java Editor can be launched from the Data Perspective, the Debug Perspective, and the
Java Perspective.
From the Data Project Explorer:
a. Right-click the stored procedure and select Open. The stored procedure DDL is
displayed in the Routine Editor view.
b. Click the java tab. The Java source is displayed (Figure 1-22).
45
When a Java stored procedure is deployed with debug enabled, you can debug the Java
stored procedure from Data Studio IDE or Optim Development Studio. The Debug
Perspective is automatically launched and the Java source is displayed in the source
area.
From the Java Perspective, select the Project Explorer:
a. Open the package or the default package to the .java or .sqlj file.
b. Double-click this file.
In Optim Development Studio, when working with pureQuery, the Java editor is launched at
the end of the New Java Class wizard.
Java routines built by the Data Studio conform to the SQLJ Routines specification. Java
objects are defined in the catalog table with LANGUAGE JAVA and PARAMETER STYLE
JAVA. Java objects must follow these rules:
The method that is mapped to the object must be defined as a public static void method.
The object must receive input parameters as host variables.
Output and InOut parameters must be set up as single element arrays.
When editing your source in the Java editor, your changes are dynamically compiled and
errors reported immediately. When you add arguments to the .java or .sqlj main method and
then save the changes, they are reflected as input parameters in the DDL tab.
As in SQL stored procedures, changes to the source code of Java stored procedures only
change the object in the workspace. To replace the object in the server, redeploy the Java
stored procedure.
To close any object, open it in the Editor, click File Close Object or File Close All, or
click the X next to the procedure name in the Routine Editor.
Export wizard
Use the Export wizard to export routines from your current project to the file system for later
deployment. Data Studio supports exporting an entire project or just the stored procedures.
You might want to export the entire project to the file system, which can then be imported into
another workspace. In this book, we discuss exporting stored procedures only.
You can export a specific stored procedure or several stored procedures at a time. To export
routines using the Export wizard:
1. In the Data Project Explorer, right-click the Stored Procedures folder and select Export.
2. On the Selection page, click the check boxes for the stored procedures that you want
to export. You can also click Select All to select all stored procedures in this folder.
Click Next.
3. On the Target and Options page, type the file name and directory where the exported
script is sent. You can optionally click Browse to launch the file browser.
4. Click Next or Finish. The wizard exports the selected routines to the file name and
directory that you specified.
Note: Optim Development Studio supports enterprise deployment through its
implementation of server profiles (see 3.2.3, Server profiles on page 110) and
deployment groups (see 3.2.4, Deployment groups on page 111).
46
Import wizard
Use the Import wizard to import routines to your project. To open the Import wizard:
1. In the Data Project Explorer, right-click the Stored Procedures folder and click Import.
The Import wizard is launched.
2. On the Import wizards Source page (Figure 1-23), select the location of the object or file
that you want to import. You can import from the file system or from another project in this
workspace.
3. Click Browse to select the directory or project that contains the stored procedure. A file
browser is launched. Click OK after selecting the stored procedure.
4. If you are importing an SQL stored procedure, you can optionally set the statement
terminator used in the imported file. Click Next.
5. The next page shows the discovered entry points for this stored procedure. You can
verify whether the imported stored procedure is correct. Click Next.
Note: If there are multiple CREATE PROCEDURE statements in the imported file, only
the first CREATE PROCEDURE statement is processed and imported by Data Studio.
6. The next page shows the parameters of the imported stored procedure. You can change
the parameter data types of imported Java stored procedures. You cannot change the
parameters of imported SQL stored procedures. Click Next.
7. The next page of the Import wizard allows you to specify import options. You can opt to
replace stored procedures with the same name and parameter signature that already exist
in the project. Click Next or Finish.
Deploy wizard
Use the Deployment wizard to deploy routines to a target database. The target database
must be compatible with the database for which the object was created.
The wizard consists of four steps. First, select the target database and enter your user ID and
password. Next, select the routines that you want to deploy. Then specify deployment and
47
error handling options. A summary of the deployment options that you specified in the wizard
is displayed in the last page.
To deploy routines to a target database using the Deployment wizard, open the Deployment
wizard and:
1. In the Data Project Explorer, select a project Stored Procedures select a stored
procedure.
2. Right-click this stored procedure and click Deploy. Alternatively, from the Routine Editor,
you can click the Deploy icon.
3. Complete the necessary steps of the wizard.
4. Click Finish. The wizard deploys the routines to the target database.
48
Chapter 2.
49
In 2.2, Creating a new stored procedure on page 60, after we have created our connection,
projects, and scripts, we continue our discussion about creating, building, and executing our
stored procedure.
The next window that appears is the Data Studio Task Launcher window. To close the Task
Launcher window, click the X in the top right corner of the title bar.
The new window presented is the Data Perspective, which is the default perspective when
the Data Studio IDE or Optim Development Studio is launched. For Data Studio stand-alone,
the default perspective is the Database Administration perspective. You can change the
perspective by selecting the title bar Window Open Perspective, and selecting from the
list presented.
50
Configuring preferences
Each workspace has a set of preferences that is stored in an Eclipse resource. To view the
preferences specific to stored procedures, click Window Preferences Data
Management SQL Development. Click the following folders to set specific
preferences for:
SQL Results View Options
Deploy window rendering/display mode
Maximum number of rows to retrieve and maximum number of rows to display
Default display for NULL
Routines Deploy Options
The JDK level used when generating and compiling Java stored procedures
The location of the SQLJ translator used for translating SQLJ stored procedures
Deploy options for Java, External SQL, and Native SQL stored procedures
Routines Process
Commit setting.
Save files after build.
Set tracing on.
Routines Templates
View or create routine templates.
Import a master template.
You can also set the Unified Debugger preferences in the preferences: Run/Debug
Routine Debugger IBM to decide on the location of the Session Manager: on the server,
on the client (built-in), or launched separately in the server or on another workstation.
Session Manager information for the Unified Debugger is in 4.1, The Unified Debugger on
page 116.
51
The New Connection Profile wizard is launched when you click the New Connection Profile
icon in the Data Source Explorer (Figure 1-8 on page 28). The wizard can also be launched
by right-clicking Database Connections folder and clicking New. The wizard is also
embedded in the Deploy and New Project wizards. Figure 2-2 shows the first page of the
wizard.
You fill in the location, host, and port number from the DDF information for this subsystem
(Figure 2-3).
LOCATION
LUNAME
GENERICLU
STLEC1
USIBMSY.SYEC1DB2 -NONE
TCPPORT=446 SECPORT=0
RESPORT=5001 IPNAME=-NONE
IPADDR=::9.30.222.229
SQL
DOMAIN=UTEC730.vmec.svl.ibm.com
DSNLTDDF CURRENT DDF OPTIONS ARE:
PKGREL = COMMIT
DSNLTDDF DISPLAY DDF REPORT COMPLETE
Figure 2-3 Display DDF output
52
IBM Data Server driver for JDBC and SQLJ (JDBC 4.0) using Kerberos security
IBM Data Server driver for JDBC and SQLJ (JDBC 4.0) using LDAP
IBM Data Server driver for JDBC and SQLJ Default
IBM Data Server driver for JDBC and SQLJ using Kerberos security Default
IBM Data Server driver for JDBC and SQLJ using LDAP
Other Default Driver
If you choose Other Default Driver, you need to provide the JDBC driver class name,
class location, and connection URL.
Location: Enter the DB2 for z/OS location ID.
Host: Enter the domain or FTP address of your DB2 for z/OS server.
Port number: Enter the port number of your DB2 for z/OS server.
JDBC driver class: When using the IBM Universal driver, this is pre-filled with the value
com.ibm.db2.jcc.DB2Driver.
Class location: When using the IBM Data Server driver for JDBC and SQLJ (JDBC 4.0),
this is pre-filled with the location of the license jar files installed with your Data Studio.
Retrieve objects created by this user only: Check this box if you want to work only with
objects that you created.
User name: Enter your DB2 for z/OS login authorization ID.
Password: Enter the password associated with the above user ID.
Save password: Check this box if you want to use this ID and password every time that
you connect to this server.
Connection URL: Data Studio composes this as you enter values for the location, host,
and port number. It additionally adds default JDBC properties.
The Test Connection button allows you to test the connection using the fields that
you entered.
1
53
Tracing
The JDBC tracing options can be set in the connection URL by selecting the trace levels on
this tab of the New Connection wizard. For more information about tracing levels and other
problem determination tools for Data Studio, see:
http://www.ibm.com/developerworks/db2/library/techarticle/dm-0706scanlon/
Optional
Data Studio allows the user to append certain JDBC connection properties in the connection
URL. You need to be familiar with the specific JDBC connection properties that you want to
set, as well as the format of the specification.
Click Finish to complete creating the connection.
54
When you upgrade Data Studio to a new release, you might need to edit the connection
properties on your workspace so that you pick up the latest jars. Figure 2-5 shows a typical
error that you might get when connecting.
Connection has failed. The following error was reported:
--------------------------------------------------------java.io.FileNotFoundException:
C:\Program\IBM\SDP70Shared\plugins\com.ibm.datatools.db2_1.0.100.v200707172230\
driver\db2jcc.jar
Do you want to work offline?
--------------------------------------------------------Figure 2-5 Typical connection error
Click the Edit driver definition icon. On the Edit driver definition dialog, click the Jar List tab.
Click the Add JAR/zip, then use the file browser to point to the directory where the JDBC
driver jars are. You can also opt to remove or edit the jar files from this dialog.
55
Select connection: The wizards second page lists all the connection profiles available
(Figure 2-7). The user can also opt to create a new connection profile by clicking New. The
New Connection Profile wizard is launched. The properties of the selected connection are
shown in the Properties area of this page.
The wizards third page allows the user to specify the authorization ID for package owner and
build owner.
Package Owner: Enter a valid primary or secondary authorization ID as the package
owner. If blank, the current login ID is used.
Build Owner: Enter a valid primary or secondary authorization ID as the owner of the
stored procedure created. This is the value in the OWNER column in SYSROUTINES. If
blank, the current ID is used.
56
Click Finish in the wizard to create a data development project. Figure 1-15 on page 37
shows you the folders contained in a data development project.
57
The SQL Query Builder populates the Editor view with three panes (the top three icons in
Figure 2-9 are the three panes). Choose the the SQL statement view.
58
59
In Data Studio, you can also use or create code templates. This allows you to skip typing
parts of an SQL statement and tab into input fields within the templates. Figure 2-10 shows
an example of a template.
To use this template and create the SQL statement in the Enhanced SQL Editor, we took the
following steps:
1. Right-click the SQL Scripts folder and select New SQL or XQuery script.
2. Type SE_Select1 for the statement name. Click Edit using the SQL Editor.
3. A blank editor page is created. Press Ctrl+Spacebar to activate the Content Assist.
4. Type S to see template choices that start with S. Select SELECT - SELECT statement
with two columns template.
5. In the editor the cursor is placed in col1. Type PURCHASEORDER.POID.
6. Tab to col2. Type CUSTOMER.INFO.
7. Tab to table1. Type PURCHASEORDER.
8. Tab to table2. Type CUSTOMER.
9. Press Esc to return to the normal editing mode.
You can create your own SQL statement template in the Preferences of Data Studio. In the
menu bar, click Window Preferences Data Management SQL Development
SQL and XQuery Editor Templates.
Whether you use the SQL Query Builder or the SQL and XQuery Editor, your created scripts
are saved in the SQL Scripts folder.
60
Name
Specify the name of the stored procedure. You might also qualify the stored procedure name
with a schema qualifier (for example, MYSCHEMA.MYPROC).
Note: Data Studio accepts uppercase and lowercase schema.procname. However, when
the SQL or Java stored procedure is built, both schema and procname are converted to
uppercase in the DB2 catalog on z/OS. To enter lowercase, enclose the name in quotation
marks, for example, MyProc.
Language
Select from the pull-down menu the language for this stored procedure. Data Studio only
supports SQL or Java stored procedures. When you select SQL, you are presented with the
default templates for both Native and External SQL stored procedures. If you select Java, the
templates list is changed to display templates using dynamic Java (JDBC) or static Java
(SQLJ).
Note: In DB2 for z/OS, the default version for native SQL procedures is V1.
61
The template area below the language area contains two tabs describing the template that
you have selected.
Default templates
Data Studio provides three basic default templates:
You specify the SQL statement that returns a result set.
The stored procedure has two parameters:
Input
Output
The stored procedure returns a result set.
Template DDL
This is a preview of the CREATE PROCEDURE DDL. If you are creating a SQL stored
procedure, the SQL Body is also shown in this tab.
When you click Finish from the New Stored Procedure wizard, Data Studio generates the
DDL and, in the case of Java stored procedures, the Java source. The DDL is rendered in the
Routine Editor, whereas the Java source is rendered in a Java Editor.
When generating the DDL, Data Studio uses values from Preferences Routines
Deploy Options.
For Java stored procedures, it picks up the bind options and WLM Environment
preferences.
For External SQL stored procedures, it picks up precompile options, compile options,
prelink options, link options, bind options, runtime options, WLM environment, and
collection ID.
For Native SQL stored procedures, it picks up procedure options and (optionally) the WLM
environment, which can be used when debug is enabled. Consult the SQL Reference for
details on the procedure options that you can specify in your native SQL stored procedure.
Note: Although native SQL stored procedures do not require you to specify a WLM
environment, you still need to specify a default WLM environment in your DSNZPARM.
2.2.2 Copying and pasting (or dragging and dropping) from the Data Source
Explorer
In Data Studio, you can copy and then paste or drag and drop a stored procedure that has
been previously deployed from the Data Source Explorer to a Data Project Explorer. You can
copy an SQL or Java stored procedure from one server, paste it to a project, modify as
needed, and then deploy to another server. This can be between like platforms and servers or
different platforms and servers. Some syntax errors might occur if the stored procedure
contains non-standard (that is, platform-specific) SQL.
62
63
For SQL and Java stored procedures, examples of code fragments are:
Header fragment: This can contain text such as prologs, copyright information, author,
modification history, and so on.
Imports fragment (Java): This can contain a list of common imported Java packages.
Variable / Data declaration fragment: This can contain code for declaring or initializing
global variables, local variables that might follow a specific naming convention, and so on.
Exception handlers fragment (SQL): This can contain code for handling exceptions
encountered when executing the stored procedure.
Pre-return fragment: This can contain code for cleanup, finalize-ing, logging, reporting,
and other end-of-task code that might be common to all your stored procedures.
Method fragment: This can contain code for common methods called within a Java stored
procedure. You can reference methods in your source that are not coded in the Java
stored procedure. Section 3.1.9, Multiple jar support for Java stored procedures on
page 99, describes how to add a supporting jar that contains these methods.
Note: The file browser defaults to presenting you with files that have a .sql, .ddl, or .db2
file extension. You can only select one file to insert. You have to position your cursor to the
location of where you want the file inserted. When inserting a file containing SQL
Statements into the Java source, you are responsible for coding the JDBC APIs and
Java-specific code needed to process the SQL statements.
64
Source
On the Source page, you have the option to import from an existing project or the file system
(Figure 2-12).
65
3. Select the stored procedure that you want to import. Click OK to dismiss this dialog.
4. Click Next to go to the next page in the Import wizard.
66
67
Parameters
Data Studio displays the parameters and their data types on this page. You can edit the SQL
data types of the parameters in a Java stored procedure (Figure 2-15).
68
Options
On this page, you can set the following options needed to deploy the imported stored
procedure (Figure 2-16):
Collection ID
Replace duplicate routines in the project
Deploy on Finish (Automatically deploy the imported stored procedure on finish.)
Enable debugging (when you deploy the imported stored procedure)
Click Advanced to specify additional stored procedure and deploy options, similar to those
shown in Figure 2-20 on page 76.
Click Next to display the Summary page.
Summary
The summary page summarizes the above settings. Click Finish to terminate the Import
wizard. The imported stored procedure is added to the Stored Procedures folder.
Note: When importing an SQL stored procedure from the file system to a project that is
targeting a DB2 10 for z/OS, if the imported DDL does not contain the FENCED or
EXTERNAL keyword, Data Studio constructs the imported SQL stored procedure as a
Native SQL stored procedure.
69
Right-click the Stored Procedures folder and then select Import to launch the Import wizard.
On the Source page, select the location of a .java file in the file system or a Java stored
procedure from another project.
If the imported stored procedure is a Java stored procedure, Data Studio examines the
methods that are included in the file. Data Studio selects as the main entry point the method
that is named the same as the file as shown in Figure 2-17.
Figure 2-17 Import wizard - Entry points for a Java stored procedure
The Options page when importing a Java stored procedure is slightly different. On this page,
you can:
Similar to SQL stored procedures, you can also click Advanced to specify additional deploy
and routine options, such as the WLM environment name.
70
71
Let us assume that you clicked the Deploy the routine to the database server icon. The
Deploy wizard is launched (Figure 2-19).
72
If the stored procedure is unqualified, you can specify the target schema for this routine. The
pull-down menu shows you all schema names used so far within the project. The default
schema is the login ID.
When launched from the Stored Procedures folder, the Deploy wizard allows you to select multiple stored
procedures from the folder. When a stored procedure of the same name exists on the server, this option instructs
Data Studio to ignore deployment of this stored procedure. Data Studio continues to process and deploy the other
stored procedures in the list. The default is to terminate when a duplicate is found.
3
When deploying a stored procedure from a list, if the stored procedure has errors (for example, missing objects),
then this option instructs Data Studio to ignore these errors and continue deploying the other stored procedures in
the list.
73
Collection ID
Runtime options (External SQL stored procedures only)
WLM Environment
Procedure options:
ASUTIME
STAY RESIDENT
EXTERNAL SECURITY
For native SQL stored procedures, you can set the options shown in Figure 2-24 on page 80.
When the Enable Debugging check box is selected, you are asked to enter a WLM
environment that is used when debugging this stored procedure.
Native SQL stored procedures are interpreted rather than compiled like an external SQL
stored procedure. Specify both procedure and bind options in the Procedure Options field.
See 2.5.7, Setting the bind options in native SQL stored procedures on page 80, for
information about setting these options.
Note: The Build owner field is the authorization ID that is used to issue the CREATE
PROCEDURE statement and hence is the value in the OWNER column of the stored
procedure in SYSROUTINES. If there are unqualified objects in the SQL body, these
objects are qualified by the value of the CURRENT SQLID, unless the QUALIFIER bind
option is specified in the Procedure options.
74
For an External SQL stored procedure, you can set the following:
Build Utility: Specify the SQL Procedure processor to use to build this external SQL stored
procedure. The default is the build utility value specified in the preferences.
Build Owner: Specify the authorization ID that is the owner/definer of this external SQL
stored procedure. See 3.1.4, Package owner and build owner on page 88, for more
information about this field.
Precompile options: This defaults to MAR(1,80).
Compile options: This defaults to NOTEST(block,noline,nopath).
Prelink options: Specify any prelink options (default is blank).
Link options: Specify any prelink options (default is blank).
Bind options: The bind options are specified in two parts. The PACKAGE area is read-only
and defaults to PACKAGE(collid), where collid is the collection ID specified in the Deploy
Options preference page.
Enable debugging: Check this box if you want to use the Unified Debugger later on for
debugging this stored procedure.
For a Java stored procedure, you can:
Click the Enable debugging check box to set up the deployed stored procedure for
debugging. The compile option -g is automatically generated.
Specify a different JDK level for the client by clicking Browse for the JDK home and
pointing the file browser to the directory of your JDK. Data Studio interrogates the JDK
that you specified and fills in the JDK version field.
Add additional bind options in the space to the right of the PACKAGE field. Click the
ellipsis to display a text box for typing in your bind options.
Display all messages generated during the deploy process by clicking Verbose build.
75
76
Click Finish to close the Deploy wizard. The Data Output view is refreshed with the status
and progress of the deploy.
Target servers
DB2 for LUW V8.2 and
V9
Java
Derby
Java
N/A
N/A
N/A
N/A
N/A
N/A
77
Source servers
Target servers
DB2 for LUW V8.2 and
V9
N/A
N/A
78
Figure 2-23 shows how to set the JDK home for a specific stored procedure during deploy.
Data Studio issues a UDF to determine the JVM level of the DB2 for z/OS server. The JVM
level or version can also be determined from the JAVA_HOME environment variable set in
DB2 for z/OS UNIX System Services.
79
80
If there are any input parameters in your stored procedure, the Specify Parameter Values
dialog is launched (Figure 2-25).
Note that the tooling can recognize that a string was entered even though single quotation
marks were not entered. However, double quotation marks are preserved in the input value.
To enter FOR BIT DATA, type an X in front of a quoted value (for example, XF1F2F3).
81
You can opt to execute SQL statements before and after calling a stored procedure, as when
a stored procedure is manipulating a table. You can do this using the Run Settings dialog
(Figure 2-26).
On the Parameter Values page, specify the parameters that you want to use for running the
routine. If a parameter requires a string value, type the value without string delimiters. If the
parameter requires binary input, enter the hex string without delimiters.
82
Results tab
If you have multiple result sets, the actions below only apply to the result set page in view.
Select a cell or a set of cells (by pressing Ctrl+click). Right-click to see the context menu
actions shown in Figure 2-27.
Copy Row(s): Saves the selected rows to the clipboard.
Save ... Current Result / All Results: Saves the result sets into a file within a project.
In the Save Result set dialog, you can select the project container of the exported
result set, the file type, character encoding, and format of the saved result set
(Figure 2-28 on page 84).
Export ... Current Result / All Results: Saves the results into a file in the file system.
Use the Browse button to launch the file browser. You also have the option to set the
file type, character encoding, and format of the exported file.
Print ... Current Result / All Results: Prints the results to a connected printer. Results
are printed in a table format.
Convert row(s) to hexadecimal: Converts the column data to hexadecimal.
83
84
Chapter 3.
85
86
Type or copy and paste the CREATE PROCEDURE DDL for either a SQL or Java stored
procedure. For Java stored procedures, type or copy and paste the Java source as well.
Data Studio allows you to insert variables into the template. To insert a variable, position the
cursor to where you want the variable inserted, then click Insert Variable. Data Studio allows
automatic insertion of the variables listed in Table 3-1.
Table 3-1 Insertion variables
Variable name
Description
collid
date
Current date
name
Routine name
runOpts
schemaName
Schema name
87
time
Current time
timestamp
Current timestamp
user
User name
wlmEnvironment
year
Current year
Name specified in
New SP wizard
SYSROUTINES
SCHEMA column value
blank
PROC1
PAOLOR5
blank
DEVL4717.PROC1
DEVL4717
DEVL4717
PROC1
DEVL4717
DEVL4717
PAOLOR1.PROC1
PAOLOR1
88
3. On the Target and Location page, enter a file name for the exported xml file. Enter a
directory location or click Browse to choose a directory.
89
4. Click the Include DROP statements check box. Figure 3-4 shows the completed page.
5. Click Finish.
6. Verify that the export is successful for each stored procedure in the Output view. In our
example, we exported four stored procedures. The Output view in Figure 3-5 shows four
entries, all of which are successful.
90
Open a DB2 command window and go to the directory that you specified for your
exported files.
Buildfile: ITSO_Project_sql.xml
init:
builddeploySps:
[createsp] Debug options:
[createsp]
file:/C:/Export/.options loaded
[createsp] Could not connect to the target database.
[createsp] [ibm][db2][jcc][t4][2013][11249] Connection authorization failure
occurred. Reason: User ID or Password invalid.
BUILD SUCCESSFUL
Total time: 3 seconds
91
92
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
[jcc][sqlj]
Begin Customization
Set qualifier for online checking to SCHEMA: PAOLOR4
Loading profile: marichu\SQLJTEST_SJProfile0
Customization complete for profile marichu\SQLJTEST_SJProfile0.ser
Begin Bind
Loading profile: marichu\SQLJTEST_SJProfile0
User bind options: QUALIFIER PAOLOR4
Driver defaults(user may override): BLOCKING ALL VALIDATE BIND
Fixed driver options: DATETIME ISO DYNAMICRULES BIND
Binding package S9282881 at isolation level UR
Binding package S9282882 at isolation level CS
Binding package S9282883 at isolation level RS
Binding package S9282884 at isolation level RR
Bind complete for marichu\SQLJTEST_SJProfile0
BUILD SUCCESSFUL
Total time: 24 seconds
93
94
For an external SQL stored procedure, the DBRM, package, and load module are copied
from the source database to the target database, and the CREATE PROCEDURE DDL is
executed to catalog the stored procedure in the target database. The SQL body is not copied
to SYSROUTINES_SRC.
95
96
4. Select the users who you want to give execute privileges to by clicking the corresponding
check box (Figure 3-7).
5. Click Preview DDL to see the GRANT statements.
6. Click Open with SQL Editor to persist the statements into a script in the project. This is
suggested, as you are able to run this script against multiple servers.
7. Click Run DDL to execute the GRANT statements against the currently connected server.
97
98
This applies to Java stored procedures using SQLJ and external SQL stored procedures, not to native SQL
procedures. Native SQL procedures packages are DB2-controlled.
99
100
9. Select the default class and click OK. Figure 3-10 shows the completed Java Path page.
10.Click Finish.
Data Studio creates a dependency on the added jar file and calls the ALTER_JAVA_PATH
DB2-supplied stored procedure during the deploy. The supporting jar is also included in the
jar file that is installed in the server.
You can also add previously deployed jars by dragging and dropping them from the Data
Source Explorer into the Jars folder of the Data Development Project.
From the Data Source Explorer, you can also
101
2. The New Web Service dialog is displayed (Figure 3-12). Enter a name. You can specify
your own namespace or use the default URI for this web service. Click Finish.
102
3. To add a stored procedure to this web service, Right-click the stored procedure and then
select Add to Web Service (Figure 3-13).
103
4. In the Add Operation to Web Services page, select the web service that you previously
created in the left panel. Click >. The web service is moved to the right panel
(Figure 3-14). Click Next.
Figure 3-14 Select the web service to add this stored procedure to
5. In the Name and Operator page, the name and operation are prefilled with the stored
procedures name and a generated CALL to the stored procedure. Click Next.
Data Studio can generate detailed or generic XML schemas for stored procedures that
accept non-varying input values and return result sets that are always the same. To make
the XML schema as detailed as possible, Data Studio needs to know the structure of
these unchanging result sets. This information is obtained by running the stored
procedure and capturing the input and result set information. The XML schema is
generated from this run.
104
6. In the Generate XML Schema for Stored Procedure page (Figure 3-15), click Generate.
7. The call to the stored procedure is executed, and you see the stored procedure result set
in the Output view. Click Finish.
8. You can now deploy the web service to an application server like WebSphere Application
Server or Tomcat. To deploy the web service, right-click the web service and select Build
and Deploy from the context menu.
105
9. The Deploy Web Service dialog is launched (Figure 3-16). Click Finish to complete the
deploy of the web service.
106
Data Studio generates the web service runtime files, such as the WebSphere Definition
Language (WSDL) file. The project folder is refreshed and the WSDL is added to the XML
folder (Figure 3-17).
Configuration repository
Enhanced connection error handling
Server profiles
Deployment groups
pureQuery support
107
108
If the connection is lost, Optim Development Studio attempts to reconnect to the server. If
Optim Development Studio cannot reconnect, it displays a message that the connection to
this server has been lost. A dialog is launched to request an action from the user
(Figure 3-19). Click OK to attempt to reconnect. Click Cancel to abort attempting
to reconnect.
If your connection fails due to any other reason other than a lost connection, Optim
Development Studio presents a dialog that explains the problem, and also gives you links to
support information for debugging the problem (Figure 3-20).
Optim Development Studio continues to standardize error messages for all components in future releases.
109
110
In addition, users can create their own non-generated server profiles with the New server
profile toolbar button (Figure 3-22). Users can create multiple server profiles against the
same connection, using different settings for different deployment needs.
Right-click a server profile icon and click Open or double-click a server profile to manage the
settings for this profile.
As shown in Figure 3-22, you can set the:
Special registers to be used for the database connection
Default bind options and pureQuery static bind options
Routine options for each type of routine
The developerWorks article IBM Optim Development Studio: Test deployment simplified
provides an excellent discussion on the use of server profiles in an enterprise environment. It
is available from:
http://www.ibm.com/developerworks/data/library/techarticle/dm-1010testdeployment/
index.html
111
the same server or change the options each time that he redeploys. The deploy options are
not persisted.
Optim Development Studio 2.2.1 introduces the concept of deployment groups. A deployment
group is an ordered list of supported deployable artifacts from projects in your workspace.
These artifacts include SQL Scripts, stored procedures, and user-defined functions.
Deployment groups are associated with one or more server profile objects.
Deployment groups allow you to deploy artifacts in a repeatable and auditable manner. This
is especially advantageous when the deployment order is important because of artifact
dependencies and when working with other developers who might want to deploy the same
set of artifacts in their environment.
The Deployment Manager view (Figure 3-23) lists the deployment groups, along with their
associated artifacts and server profiles. The Deployment Results folder stores a history of
the deployment.
As discussed in the previous section, server profiles are used to specify a target database
connection, along with specific database, bind, and routine settings for deployment.
Deployment groups also keep track of the deployment history and status including timestamp
information, status for a particular artifact in the group, and error/success results.
The developerWorks article IBM Optim Development Studio: Test deployment simplified
provides an excellent discussion on the use of deployment groups in an enterprise
environment, along with the discussion on server profiles. It is available from:
http://www.ibm.com/developerworks/data/library/techarticle/dm-1010testdeployment/
index.html
112
113
114
Chapter 4.
115
116
The chart in Figure 4-1 describes the processing flow for debugging stored procedures using
the Data Studio Unified Debugger.
Workstation
Setup debug
Preferences
z/OS
Create/Edit SP
Enable Debug
Deploy
2
SESSION
MANAGER*
SM Stored procs
7b
Debugger router
Stored procs
DB2-supplied
SPs
7a
Debug
Debug
Perspective
7b
4, 8
5
Debug Library
JVM
SQL / Java SP
Execution
Debug WLM
Figure 4-1 Processing overview - Unified Debugger with DB2 9 for z/OS
117
DB2DEBUG.DEBUGGERLEVEL
DB2DEBUG.CREATE_SESSION
DB2DEBUG.DESTROY_SESSION
DB2DEBUG.QUERY_SESSION
DB2DEBUG.LIST_SESSION
DB2DEBUG.PUT_COMMAND
DB2DEBUG.GET_REPORT
SYSPROC.DBG_INITIALIZECLIENT
SYSPROC.DBG_TERMINATECLIENT
SYSPROC.DBG_SENDCLIENTREQUESTS
SYSPROC.DBG_SENDCLIENTCOMMANDS
SYSPROC.DBG_RECVCLIENTREPORTS
SYSPROC.DBG_ENDSESSIONMANAGER
SYSPROC.DBG_PINGSESSIONMANAGER
SYSPROC.DBG_LOOKUPSESSIONMANAGER
SYSPROC.DBG_RUNSESSIONMANAGER
DSNTIJRT also configures the WLM environment for the above stored procedures.
Note: Stored procedure DBG_RUNSESSIONMANAGER is only available for DB2 9
and 10 on z/OS and must run as an authorized program in an authorized environment.
118
119
120
//SYSTSIN DD *
OCOPY INDD(INLINE) OUTDD(HFSOUT) TEXT
//
Create a file in the HFS to hold the environment settings used when the Unified Debugger
Session Manager runs as a started task on z/OS.
An ID must be designated to be associated with the started task. Suppose that USRT005 is
that ID. Place a file in that user's home directory to serve as an execution environment profile.
The file must point to the location of the Session Manager jar file, db2dbgm.jar. Name the file
something distinctive, such as DB2UDSMDprofile.
Note: Ensure that the CLASSPATH points to where the db2dbgm.jar file is installed.
Otherwise, the started task, DB2UDSMD, does not come up.
In both Example 4-1 on page 119 and Example 4-2 on page 120 we used USRT005 as the
place holder for the ID associated with started task DB2UDSMD, which you must change to
your specific situation.
The use of a named HFS application profile is suggested for simple setup and segregation of
duties. At a minimum, it needs to define the CLASSPATH to the Session Manager Java
program. Other settings to tune the Java execution environment can be included. Note that
BPXBATCH reads the STDENV file, so no shell script symbol substitution can be utilized here.
Symbol substitution processing is only available to the user profile (.profile) for the started
task user ID and scripts executed from the shell command line.
The Session Manager is independent of DB2, so it can run anywhere in the network. But the
server platform (that is, the operating system that the stored procedure that you want to
debug runs) is often a better default choice than running at the client workstation. The session
Manager JAR file is now distributed on all server platforms, so it does not have to be
obtained, downloaded, sent, pulled, pushed, or transported by you.
//UDBG3
JOB 'USER=$$USER','<USERNAME:JOBNAME>',CLASS=A,
//
MSGCLASS=A,MSGLEVEL=(1,1), REGION=4096K,
//
USER=********,PASSWORD=*******
//*-------------------------------------------------------------------//* Create the Started Task JCL for DB2UDSMD. A START command will then
//* be able to launch the Unified Debugger Session Manager on z/OS.
//* USRT005 is the ID associated with the Started Task, as defined in
//* the RACF STARTED class profile DB2UDSMD.**
//*-------------------------------------------------------------------//*-------------------------------------------------------------------//* Use IEBUPDTE to write a JCL member into SYS1.PROCLIB
//*-------------------------------------------------------------------//WRITEJCL EXEC PGM=IEBUPDTE,PARM=NEW
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
121
//SYSUT2
DD DISP=SHR,DSN=SYS1.PROCLIB
//SYSIN
DD DATA
./ ADD NAME=DB2UDSMD
//DB2UDSMD PROC PORT=4553,TIMEOUT=60
//*
//*
DB2 Unified Debugger Session Manager DAEMON FOR OPENEDITION
//*
//*
This JCL assumes no .profile exists for the user.
//*
//* Environment settings (PATH, CLASSPATH) come from STDENV file.
//*
//DB2UDSMD EXEC PGM=BPXBATCH,DYNAMNBR=128,REGION=0M,TIME=1440,
//
PARM='SH date;java com.ibm.db2.psmd.mgr.Daemon -timeout
//
&TIMEOUT -port &PORT -log /dev/null;date'
//STDOUT
DD PATH='/tmp/DB2UDSMD.stdout',
//
PATHOPTS=(OWRONLY,OCREAT,OAPPEND,OTRUNC),
//
PATHMODE=(SIRUSR,SIWUSR,SIRGRP,SIROTH)
//STDERR
DD PATH='/tmp/DB2UDSMD.stdout',
//
PATHOPTS=(OWRONLY,OCREAT,OAPPEND,OTRUNC),
//
PATHMODE=(SIRUSR,SIWUSR,SIRGRP,SIROTH)
//STDENV
DD PATH='/u/usrt005/DB2UDSMDenvironment',
//
PATHOPTS=ORDONLY
//
PATHOPTS=ORDONLY
./ ENDUP
/*
Note: BPXBATCH does not derive PATH from STDENV. For the Session Manager, PATH
only needs to point to the Java run time. One approach is to specify the PATH directly on
the command line (Example 4-2 on page 120). Another method requires the use of a shell
script profile (.profile) for the started task user, which we have not included in this
documentation. Note that the job step options in the JCL shown, which include the OMVS
shell command, were carefully arranged to efficiently utilize the limited space available.
The space is limited to 100 characters in total. As shown in Example 4-3 on page 121,
there are still about 18 characters left to adjust the path specification for Java.
123456789012345678901234567890123456789012345678901234567890123456789012
//STEP3___EXEC PGM=IEFBR14,PARM='LONG PARAMETER FIELD WITHOUT COMMA DEL
//_____________IMITERS - CONTINUED IN COLUMN 16 OF THE NEXT LINE'
122
If the PARM field does not contain comma-delimited parameters, and the PARM field is
greater than 100 characters, use an STDPARM DD card. This workaround is available
with APAR OA11699. See:
http://www.ibm.com/support/docview.wss?uid=isg1OA11699
The STDPARM file can accept 65.356 bytes.
So, for example, create the file ADMF001.DB2UDSMD.PARMOMVS, which contains the
following data:
SH date;/ZOS17TC/usr/lpp/java/j1.4_64/bin/java com.ibm.db2/psmd.mgr.Daemon -timeout
&TIMEOUT -port &PORT;date
123
124
For a Java procedure, define the procedure with the ALLOW DEBUG MODE option, select
an appropriate WLM environment for Java debugging, and compile the Java code with the
-G option.
2. Launch the IBM Data Studio. Click Window Preferences Run / Debug DB2
Stored Procedure Debugger. On this page, click Use already running session
manager. Fill in the host IP address and port number of the session manager (Figure 4-4
on page 126).
3. Click Apply OK.
125
To use the Session Manager, in the IBM Data Studio preferences shown in Figure 4-4, click
Run the session manager on each connected server.
126
This value can be changed from the Preferences pages (Figure 4-4 on page 126). On
the Preference page, this is the number of seconds of inactivity before the procedure
runs to completion. We use the default value for our case study. Click OK to accept the
default value.
5. Create a new stored procedure. During the creation of the SQL stored procedure using
the New Stored Procedure wizard, check the Enable debugging check box on the Deploy
Options page. See 2.2.1, Creating a new stored procedure using templates on page 61,
for detailed steps on how to create a new SQL stored procedure.
The IBM Data Studio Data Output window includes a message indicating whether the stored
procedure performed a build for debug. For an external SQL stored procedure, the build utility
reports a BUILD_DEBUG function and whether it was successful (Example 4-7).
Example 4-7 BUILD_DEBUG function was completed successfully
When the stored procedure is launched in debug mode, the user is prompted to switch
into the Debug Perspective. Click Yes. In the Debug Perspective, you can set breakpoints
in the prefix area to the left of a valid statement, monitor and change the values of
variables, and interactively debug.
127
Note: When connected to a DB2 9 server, IBM Data Studio assumes that if the
imported SQL stored procedure contains a WLM environment, then the stored
procedure is an EXTERNAL type, rather than native. You need to manually edit the
CREATE PROCEDURE DDL before importing, and add the FENCED keyword to
correctly identify this as an External SQL procedure.
Summary: The above settings are summarized. Click Finish to build the stored procedure
for debug.
128
The Debug Perspective is made up of the following related views and tool bars:
Routine Editor view: Shows the SQL code.
Breakpoints view: Shows the list of break points currently set.
Variables view: Shows the list of defined variables.
Outline view: Shows the variables and methods of the stored procedure under execution.
Data Output: Shows the status history, execution messages, parameters, and result sets,
if any.
129
Execution toolbar: Provides icons to debug or simply execute a stored procedure. Also
keeps a list of the most recently executed stored procedures.
Debugger toolbar: Provides icons for the various debug execution step commands:
Step into
Step over
Step return
Resume
Pause
Terminate
These views are connected in the sense that the break points and variables views show the
debug data for the stored procedure currently shown in the Routine Editor view. Switching to
a different procedure in the Routine Editor causes the break points and variables views to
display the debug data for the newly selected stored procedure code. The Debug Perspective
also includes a specialized set of toolbars for debugging.
Routine Editor view
The routine editor displays the stored procedures being debugged. Each tab in the Editor
view displays an open resource. You can set breakpoints in this view, either during debug
or before initiating the debug in the Data Perspective.
Execution toolbar
The Execution toolbar includes three actions (Figure 4-7):
Debug: Executes a stored procedure in Debug mode. The pull-down list next to the
icon shows all previously debugged stored procedures. The default is to debug the last
executed stored procedure.
Run: Executes a stored procedure. The pull-down list next to the icon shows all
previously executed stored procedures. The default is to execute the last executed
stored procedure.
External tools: Executes an Ant script or another tool. IBM Data Studio does not use
this action.
130
Debugger toolbar
The Debugger toolbar includes the debug step commands illustrated in Table 4-1.
Table 4-1 Execution toolbar
Icon
Command description
Step into the next line or block of SQL code. If the current statement is a stored procedure
call, then the next line is the first line of the called stored procedure.
Step over to the next line of execution. If the current line is a call to a nested stored
procedure or the next line is an indented block of code, then the nested procedure or block
of code will be executed as one statement unless a break point was encountered.
Step return causes execution to resume at the next line in the parent stored procedure of
the current nested stored procedure unless a break point is encountered. If the current
stored procedure is the only stored procedure in the call stack, then execution will run to
completion or the next break point encountered.
Resume causes the stored procedure being debugged to run and stop or break at the next
breakpoint.
Pause causes the execution of the stored procedure to be suspended. Click Resume or
Terminate to continue or terminate execution.
Terminate causes the execution of the stored procedure to stop. This does not cause the
stored procedure to run to completion. This simulates an abort.
Variables view
The Debug Perspectives Variables view displays the current values of the defined
variables in the stored procedures. When debugging a Java stored procedure, the
Variables view also lists inherited variables.
Outline view
The Outline view in the Debug Perspective is the same as in the Data Perspective. It
shows on a higher level where in the stored procedure code execution is stopped. When
debugging a Java stored procedure, this view shows the method where the stored
procedure is stopped.
131
Breakpoints view
The Debug Perspectives breakpoints view and its associated toolbar allow you to
manage the breakpoints that you have set. When you set a breakpoint in the Routine
Editor, an entry is added in this view, with the resource name and line number. A check
box next to this entry indicates that the breakpoint is active. To disable this breakpoint, but
not remove it, uncheck the entry (Figure 4-8).
The Breakpoints view also has a specialized toolbar for managing the breakpoints
(Table 4-2).
Table 4-2 Breakpoints view toolbar
Icon
Command description
Remove a breakpoint. Click an entry or several
entries, and click this icon to remove the breakpoint.
132
Category of statements
Statements
Category of statements
Statements
133
Resources
The following 2-part articles found in developerWorks provide updated information about
the Unified Debugger. These articles are updated by the Data Studio development team
when needed.
Debugging stored procedures in DB2 z/OS with Optim Development Studio, Part 1: Use
the Unified Debugger in a sample scenario
http://www.ibm.com/developerworks/data/library/techarticle/dm-0811zhang/index.
html?S_TACT=105AGX54&S_CMP=B1113&ca=dnw-945,
Debugging stored procedures on DB2 z/OS with Data Studio Developer, Part 2:
Configure the stored procedure debug session manager on z/OS
http://www.ibm.com/developerworks/data/library/techarticle/dm-0903debugdatastudio
/?S_TACT=105AGX11&S_CMP=LP
134
Appendix A.
Reference material
In this appendix we provide additional material referenced from the preceding chapters. This
appendix contains the following:
Data Studio and Optim Development Studio V2.2.1 support features
Supported functions of the three Data Studio products
Actions on database objects from the Administration Explorer
135
Version
9.1
Comments
9.5
9.7
9.8
V5R4
8.1
9.1
10.1
Version 2.2.1.
10.0 b
11.1 b
11.5b
11.7
Oraclea
Version 2.2.1.
10g
10g R2
11g
136
Data Studio
RCP
Data Studio
IDE
Optim
Develop.
Studio
Installation options
Shell-sharing with other Optim and Rational products
Generate DB2 commands and utilities for DB2 for Linux, UNIX, and
Windows (LUW).
Optim model support: Generate an Optim OEF model and save that
model in an OEF file.
Database support
Database overview diagrams.
Integrated Query Editor (IQE) integrated with the Data Design project.
137
Product features
Data Studio
RCP
Data Studio
IDE
Optim
Develop.
Studio
SQL Builder.
Application development
SQLJ development.
X
X
138
Table A-3 lists context menu actions on database objects from the Administration Explorer.
These actions are displayed by right-clicking a specific database object in the object editor.
Table A-3 Context menu actions on database objects from the Administration Explorer
Database
object type
Analyze
impact
Aliases
Packagesa
ALTER
DROP
COPY
Generate DDL
Manage
privileges
Add to
overview
diagram
Unload
load
edit
Stored procedures
User-defined functions
User-defined types
Auxiliary tables
Constraints
Databases
Indexes
MQTs
Schemas
Sequences
Storage groups
Synonyms
Xb
Tables
Table spaces
Triggers
Views
Xb
a. The Object List Editor does not list packages yet for DB2 10 for z/OS. APAR 173902 documents this.
b. Load action not available
139
140
HPJ
AIX
I/O
Input/output
IBM
APAR
ASCII
IDE
Interactive development
environment
BLOB
IFCID
CCA
CCSID
IFI
CLI
IPLA
CLP
IRLM
CPU
ISPF
DBAT
DBD
Database descriptor
ISV
DBID
Database identifier
IT
Information Technology
DBMS
ITSO
DBRM
IVP
DC
Development Center
JCL
DCL
JDBC
DD
Distributed Debugger
JDK
DDCS
JDSD
DDF
JFS
DDL
JNDI
DLL
JRE
DML
JVM
DNS
KB
DRDA
LEL
Language Environment
LOB
Large object
DSN
LPA
DT
Debug Tool
LPAR
Logical partition
DTT
LPL
EBCDIC
LRECL
LRSN
EDM
Environment descriptor
management
LUW
LVM
FTP
MB
GB
MFI
GBP
MQT
GRS
NPI
Non-partitioning index
GUI
ODB
141
ODBA
ODBC
OS/390
Operating System/390
PAV
PDS
PIB
PSID
Pageset identifier
PSP
PTF
PUNC
Possibly uncommitted
QA
Quality Assurance
QMF
RACF
RBA
RECFM
Record format
RI
Referential integrity
RID
Record identifier
RR
Repeatable read
RRS
RRSAF
RS
Read stability
SC
Service class
SDK
SDSF
SMIT
SPAS
SPB
SQL
SQL
SQLJ
SU
Service unit
UCS
UDF
User-defined function
UOW
Unit of work
USS
WLM
WSAD
WSADIE
WSDL
142
WSED
Index
Symbols
_CEE_ENVFILE variable 15
//CFGTPSMP 13
//SQLLMOD 13
Numerics
173902 139
A
active version 86
address space 6, 120
address spaces 120
administration 137
APIs 64, 116
Application Development
Client 2
application environment
stored procedure 13
application environment (AE) 13
ASUTIME 40
authorization 11, 124
authorization ID 11, 13
B
BEGIN 133
BIND option 41
BIND Package 14
BIND PACKAGE OPTION
CURRENTDATA 14
Isolation 14
BIT 81
BPXBATCH 121
build the stored procedure for debug 126, 128
build utility
DSNTPSMP 18
BUILD_DEBUG function 127
C
CALL 104, 132
CASE 133
case study 126
catalog table 46
CFGTPSMP configuration data set 13
check box 127
class file 92
CLASSPATH 89, 16, 120
click Finish 8
client application 116
COBOL 116
code, as shown in Example (CASE) 5
COLLECTION ID 9, 75
collection ID 24
COLLID 98
com.ibm.db2.jcc.DB2D river 8
COMMENT 32
configuration file 13
configuration tab 44
CONNECT 10
connection URL 5354
COPY 120
CPU time 19
CREATE PROCEDURE 10, 128
CREATE PROCEDURE statement 47
CREATEIN 10
CS 14
CURRENT SQLID 74
D
Data Project Explorer 5, 23, 26, 127
data set 13, 119
Data Studio 1, 115
concepts 3
data type
XML 64
Database Explorer 5
New Connection icon 52
stored procedure 63
DB2 9 2
DB2 Accounting
trace 19
DB2 catalog 25
DB2 client 2
DB2 command
window 91
DB2 family ix
DB2 subsystem 17, 120
DB2 V8 2, 115
DB2 V9 118
DB2Binder utility 9
DB2-supplied stored procedure 17
DB2UDSMD 119, 122
DBRM 95
DD card 119
DD DISP 122
DD statement 6, 13
DD SYSOUT 120
DDF 52
DDL 128, 137
DEBUG MODE 124
WLM ENVIRONMENT 124
debug mode 126
debug session 117
debugging 4, 116
default SDK 21
DEFAULT Value
INSTALLATION CONTROL 14
143
E
Eclipse 3
Eclipse Workbench 3
editor 5, 130, 138
Editor view 26, 30, 130
blank editor 30
SQL Editor 32
tabbed page 43
END 119
Enhanced SQL Editor
SQL statement 60
ENQ 22
entry point
initjvm 22
environment variable 6
error handling 48, 94
error message 22
EXECUTE 10
execution status 41
execution time 98
external name 40
External SQL
procedure 24, 128
external SQL 9, 11, 115
F
file 4
144
file system 4
flexibility 64
folder 4
G
GET DIAGNOSTICS 132
global temporary table 11
GOTO 133
H
HFS 120
HFS file 15, 124
host variable 46
I
IBM Data Server driver for JDBC and SQLJ 8
IBM Data Studio
Actual Costs setup 19
authorization setup 10
client setup 7
Data Project Explorer view 35
Deployment wizard 47
Export wizard 47
getting started 23
Import wizard 46
Java SDKs 20
JDBC Driver selection 6, 20
Menu and Task Bar 48
other problem determination tools 54
Server View 39
set up specific to Java stored procedures 14
set up specific to SQL stored procedures 13
SQL Builder 57
SQL stored procedures on z/OS 24
Unicode support 12
workspace 26
IBM Data Studio (IDS) 2, 16
IBM DB2
Driver 20
IBM WebSphere Studio Enterprise Developer 116
IF 133
Import wizard 47
next page 47
index 59
input parameter 46
INSERT 11
Integrated Development Environment (IDE) 7
IP address 117
iSeries 3, 116
ISO 92
isolation level
CS 92
RR 92
RS 92
UR 92
ITERATE 133
L
LANGUAGE 46
Language Environment (LE) 15
LEAVE 133
LENGTH 122
load module 13
location name 53
LOOP 133
M
maintenance 137
materialized query tables 36
Maximum number 51
MQT 36
MSGFILE 22
Multiple version 18
O
OA11699 123
Optim Development Studio 2
Output View 5, 41
Output view 39
Data Output tab 41
Properties tab 40
stored procedure 42, 90
owner 10
P
package owner 39, 56, 88
PARAMETER STYLE
Java 46
parameter style
General 40
PATH 7, 120
perspective 4, 129, 137
privileges 10
proc 13
procedure body 45
procedure code 65, 116
PROCEDURE ddl 26
PROCEDURE Name 30
procedure name 23
PROCEDURE option 24
procedure package 98
procedure return 12
PROCEDURE statement 30, 47
procedure wizard 13, 61
project 4
public static void
method 46
pull-down list 30, 53, 94, 130
Select DEVL7083 73
pureQuery 5
Q
QUALIFIER 74
R
RACF 13, 119, 121
RACF panels 13
Redbooks Web site 149
Contact us x
REFRESH 119
REGION 120
REPEAT 133
Index
145
RESET_FREQ 16
RESIGNAL 133
resource 4
result set 42
result sets 42, 129
RETURN 133
REXX 9
REXX stored procedures 17
Right-click 30, 127
Routine Editor 19, 43, 127
Configuration tab 127
procedure name 46
RRS 9
runtime 6, 116
Runtime //JAVAENV DD statement examples 22
runtime environment 6
runtime option 22
runtime options 62
S
same name 47, 73
stored procedure 73
schema name 10
SDK 1.3.1 22
SDK 1.4.1 22
SDSF 12
SECURITY 74
security 119, 137
SELECT statement 60
semicolon 59
ser file 6, 20
shell sharing 2
SIGNAL 133
Software Developers Kit (SDK) 9
source code 44, 138
SQL 19, 115, 138
SQL Builder 138
illustrated statement 58
SQL Debugger 118
SQL Editor 29
button 60
radio button 59
SQL procedure 24, 116
SQL script 29, 36
stored procedure 57
SQL Statement
following areas 19
typing parts 60
SQL statement 13, 19
schema qualifier 59
view 42, 58
SQL stored procedure 13, 126
SQL stored procedures 9, 116
SQLCODE 133
SQLJ 138
SQLJ profile customization 93
SQLJ stored procedures 6
SQLJ.ALTE R_JAVA_PATH 93
SQLJ.ALTER_JAVA_PATH 13
SQLJ.DB2_INSTALL_JAR 26
146
SQLJ.DB2_REPLACE_JAR 26
SQLPL 133
SQLSTATE 64, 133
STAY RESIDENT 74
STDERR 122
STDOUT 122
stored procedure
address space 14
authorization ID 56
build time 20
collection ID 99
configuration options 44
entry points 47
implicit or explicit schema name 10
new version 33
Options tab 19, 99
Packages folder 41, 98
qualified name 88
result sets 104
same DB2 system 18
Web Service 102
stored procedure (SP) ix, 2, 41
stored procedures 2, 115
catalog tables 11
overview 117
use 26, 118
SYS1.PROCLIB 121
SYSADM 10
SYSADM authority 51
SYSCTRL 10
SYSIBM.SYSDUMMY1 11
SYSIBM.SYSJARCONTENTS 12
SYSIBM.SYSJAROBJECTS 11
SYSIBM.SYSJAVAOPTS 12
SYSIBM.SYSPARMS 11
SYSIBM.SYSPSM 11
SYSIBM.SYSPSMOPTS 11
SYSIBM.SYSPSMOUT 11
SYSIBM.SYSR OUTINES 11
SYSIBM.SYSROUTINES 1112
SYSIBM.SYSROUTINES_OPTS 11
SYSIBM.SYSROUTINES_SRC 11
SYSPACKAGE 11
SYSPRINT 121
SYSPROC 12, 118
SYSROUTINES_OPTS 11
SYSROUTINES_SRC 11
SYSTSIN DD 119
SYSUDUMP DD SYSOUT 121
T
target server 63, 89
same authorizations 96
stored procedure 88, 94
task name 120
temporary table 11
TIME 122
timestamp 41
triggers 28
U
UCS 12
UDF 79
Unicode Conversion Services 12
Unicode Conversion Services installation 12
Unified Debugger 10, 115116
Session manager information 51
Unified Debugger command
Pause 131
Remove a breakpoint 132
Remove all breakpoints 132
Resume 131
Show all breakpoints 132
Skip all breakpoint 132
Step into 131
Step over 131
Step return 131
Terminate 131
Universal JDBC driver 20
url jdbc
db2 9
user defined functions 112
user ID 47, 53, 121
user-defined function (UDF) 18, 28
V
VALUE 14, 133
VERSION 80
Version 3
view 45, 116
W
Web service 36, 102
default URI 102
Websphere Definition Language (WSDL) 107
WHILE 133
wizard 5, 127
WLM 6
WLM ADDRESS Space
DD
SYSTSPRT DATASET 14
WLM address space 14
WLM AE 13
WLM application environment 13
WLM environment 14, 17, 119
stored procedures 62
WLM proc 13
WLM Spa 6, 20
JAVAENV DD statement 6, 20
WLM_REFRESH 13, 17
X
XPLINK 22
Z
z/OS 116
name 23
Index
147
148
Related publications
The publications listed in this section are considered particularly suitable for a more detailed
discussion of the topics covered in this paper.
IBM Redbooks
The following IBM Redbooks publications provide additional information about the topic in
this document. Note that some publications referenced in this list might be available in
softcopy only.
DB2 10 for z/OS Technical Overview, SG24-7892
Extremely pureXML in DB2 10 for z/OS, SG24-7915
DB2 9 for z/OS Stored Procedures: Through the CALL and Beyond, SG24-7604
DB2 9 for z/OS: Distributed Functions, SG24-6952
IBM Data Studio V2.1: Getting Started with Web Services on DB2 for z/OS, REDP-4510
You can search for, view, or download Redbooks, Redpapers, Technotes, draft
publications and Additional materials, as well as order hardcopy Redbooks publications,
at the following website:
ibm.com/redbooks
Other publications
Additional information can also be found in the following publications:
DB2 10 for z/OS Application Programming and SQL Guide, SC19-2969
DB2 10 for z/OS Application Programming Guide and Reference for Java, SC19-2970
DB2 10 for z/OS Codes, GC19-2971
DB2 10 for z/OS Command Reference, SC19-2972
DB2 10 for z/OS Data Sharing: Planning and Administration, SC19-2973
DB2 10 for z/OS Installation and Migration Guide, GC19-2974
DB2 10 for z/OS Internationalization Guide, SC19-2975
DB2 10 for z/OS Introduction to DB2 for z/OS, SC19-2976
IRLM Messages and Codes for IMS and DB2 for z/OS, GC19-2666
DB2 10 for z/OS Managing Performance, SC19-2978
DB2 10 for z/OS Messages, GC19-2979
DB2 10 for z/OS ODBC Guide and Reference, SC19-2980
DB2 10 for z/OS pureXML Guide, SC19-2981
DB2 10 for z/OS RACF Access Control Module Guide, SC19-2982
DB2 10 for z/OS SQL Reference, SC19-2983
149
Online resources
These websites are also relevant as further information sources:
Data Studio features and benefits
http://www.ibm.com/software/data/optim/data-studio/features.html
Data Studio support portal
http://www.ibm.com/support/entry/portal/Overview/Software/Information_Management
/IBM_Data_Studio
Support for Unicode: Using Conversion Services, SC33-7050
http://www.ibm.com/servers/s390/os390/bkserv/latest/v2r10unicode.html
Data Studio stand-alone and IDE versions available from the IBM Support website
http://www.ibm.com/support/entry/portal/Overview/Software/Information_Management
/IBM_Data_Studio
Data Studio also available as a downloadable feature from the DB2 for z/OS website
http://www.ibm.com/software/data/db2/zos/downloads/
Technote: Information about which IBM Software products can be installed together so
together so that they share a common environment
http://www.ibm.com/support/docview.wss?rs=2042&uid=swg21279139
Section Installing the IBM DB2 Driver for JDBC and SQLJ on the DB2 for z/OS
Information Center website
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.db2z10.doc
.inst/db2z_installjccintro.htm
JDBC tracing options with Data Studio
http://www.ibm.com/developerworks/db2/library/techarticle/dm-0706scanlon/
Creating scripts more efficiently in the SQL and XQuery editor
http://www.ibm.com/developerworks/data/library/techarticle/dm-1011sqlguidetour/
index.html?cmp=dw&cpb=dwinf&ct=dwnew&cr=dwnen&ccy=zz&csr=111110
Create package variations for z/OS DB2 stored procedures on developerWorks
http://www.ibm.com/developerworks/db2/library/techarticle/dm-0608parmeshwar/
Using common connections with Optim solutions
http://www.ibm.com/developerworks/data/library/techarticle/dm-0812devlin/index.
html
IBM Optim Development Studio: Test deployment simplified
http://www.ibm.com/developerworks/data/library/techarticle/dm-1010testdeployment
/index.html
IBM Optim Development Studio: Test deployment simplified
http://www.ibm.com/developerworks/data/library/techarticle/dm-1010testdeployment
/index.html
150
Increase productivity in Java database development with new IBM pureQuery tools, Part
1: Overview of pureQuery tools
http://www.ibm.com/developerworks/data/library/techarticle/dm-0709surange/index
.html
Increase productivity in Java database development with new IBM pureQuery tools, Part
2: Detect and fix SQL problems inside Java program
http://www.ibm.com/developerworks/data/library/techarticle/dm-0709surange2/index
.html
Increase productivity in Java database development with new IBM pureQuery tools, Part
3: pureQuery rapid application development
http://www.ibm.com/developerworks/data/tutorials/dm0711surange/
Increase productivity in Java database development with new IBM pureQuery tools, Part
4: Tour Data Studio and pureQuery for Informix databases
http://www.ibm.com/developerworks/data/tutorials/dm0802surange/index.html
What's new and cool in Optim Development Studio, Part 2: Exploring Optim Development
Studio and pureQuery Runtime Version 2.2 Fix Pack 3
http://www.ibm.com/developerworks/data/library/techarticle/dm-1006optimdeveloper2
/index.html
Unified Debugger
http://www.ibm.com/developerworks/db2/library/techarticle/dm-0706scanlon/
Related publications
151
152
Back cover
This IBM Redpaper publication is devoted to tools that can be used for
accelerating the development and debugging process, in particular to
the stored procedure support provided by the latest and fastest
evolving IBM product: Data Studio.
BUILDING TECHNICAL
INFORMATION BASED ON
PRACTICAL EXPERIENCE
This paper is a major update of Part 6, Cool tools for an easier life, of
the IBM Redbooks publication DB2 9 for z/OS Stored Procedures:
Through the CALL and Beyond, SG24-7604.
INTERNATIONAL
TECHNICAL
SUPPORT
ORGANIZATION