|
1
|
- Author: Jon Sayles, Enterprise Modernization EcoSystems Team
|
|
2
|
- © Copyright IBM Corporation 2007,2008, 2009. All rights reserved.
- The information contained in these materials is provided for
informational purposes only, and is provided AS IS without warranty of
any kind, express or implied.
IBM shall not be responsible for any damages arising out of the
use of, or otherwise related to, these materials. Nothing contained in these materials
is intended to, nor shall have the effect of, creating any warranties
or representations from IBM or its suppliers or licensors, or altering
the terms and conditions of the applicable license agreement governing the use of IBM software.
References in these materials to IBM products, programs, or services do
not imply that they will be available in all countries in which IBM
operates.
- This information is based on current IBM product plans and strategy,
which are subject to change by IBM without notice. Product release
dates and/or capabilities referenced in these materials may change at
any time at IBM’s sole discretion based on market opportunities or
other factors, and are not intended to be a commitment to future
product or feature availability in any way.
- IBM, the IBM logo, the on-demand business logo, Rational, the Rational
logo, and other IBM Rational products and services are trademarks or
registered trademarks of the International Business Machines
Corporation, in the United States, other countries or both. Other
company, product, or service names may be trademarks or service marks
of others.
|
|
3
|
- Thanks to the following individuals, for assisting with this course:
- Reginaldo Barosa/IBM
- David Bean/IBM
|
|
4
|
- Audience
- This course is designed for application developers who have learned or
programmed in COBOL, and who need to do z/OS Traditional Development
and Maintenance as well as build leading-edge applications using COBOL
and Rational Developer for System z.
- Prerequisites
- This course assumes that the student has a basic understanding and
knowledge of software computing technologies, and general data
processing terms, concepts and vocabulary, as well as a working
knowledge of COBOL and z/OS.
- Knowledge of SQL (Structured Query Language) is assumed for database
access is assumed as well.
- Basic PC and mouse-driven development skills, terms and concepts are
also assumed.
|
|
5
|
- Course Name: Rational Developer
for System z Foundation Training
- Course Description: Learn how to
use Rational Developer for System z to do z/OS traditional development,
maintenance, support and for Enterprise Modernization of z/OS
applications
- Pre-requisites: Some experience developing COBOL applications using z/OS
is expected. A working knowledge
of SQL is also recommended.
- Course Length: ~5days – or if done in self-paced mode, at your own pace
- Topics (Agenda)
- Getting Started - installing and configuring RDz - and the course materials, and using Eclipse
- The RDz Workbench
- Code analysis tools
- Editing
- Compiling programs
- Debugging local COBOL programs
- The Data Perspective:
- Working with relational data sources
- Modifying test data
- Editing and testing SQL statements
- Working with remote system resources:
- Connecting to a mainframe
- Data management
- Accessing and editing files
- z/OS Application Development
- Creating MVS Subprojects
- Creating and customizing project properties
- Debugging z/OS Applications
- Debugging Batch Applications
- Setting Debug Tool for Online Applications
- Working with File Manager
- Creating test data
- Editing complex file-types
- Working with mainframe ABENDs using Fault Analyzer
- Creating Fault History views
- Analyzing and solving mainframe ABENDs
- Creating and modifying BMS Maps using the BMS Map Editor
|
|
6
|
- After completing this topic, you should be able to:
- Use the RDz Data Perspective to:
- Connect to local and remote databases
- Edit test data interactively
- Display results of SQL queries
- Perform DBA activities on tables in a local database
- Display the data model for your application/DB2 tables and views
|
|
7
|
- Many (in the thousands of) books exist that do an excellent job teaching
SQL.
- Additionally, sites exist on the Internet (GOOGLE: “SQL tutorials” – or “Learn SQL”) for
online (and typically free) education.
- IBM Also supplies excellent SQL and DB2 documentation:
- DB2 Documentation
- SQL Getting Started
- SQL Reference Manual
- Message (error code) Reference. Cached pdf version of full guide.
- DB2 Application Development Guide with example embedded SQL programs.
- Triggers in DB2
- Constraints in DB2
- Note: as before, in order for you to get the above links to work, run
the PowerPoint in Slide Show mode.
- Here’s an example of COBOL database access:
- http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.apsg/db2z_samplecoboldrdathreepartnames.htm
|
|
8
|
|
|
9
|
- But, we currently use SPUFI and QMF for doing DB2 work, why should we
change?
- Simple…
- 1. Functionality:
- The RDz Data Tools have vastly superior means of:
- SQL statement testing
- Managing your DB2 table test data
- Full-screen table editing
- Simple data export/import
- Doing DBA tasks
- Understanding your relational data model
- Easy access from the RDz Workbench
- The tools are completely integrated into eclipse
- 2. Cost - z/OS MIPS reduction:
- RDz is substantially less expensive than TSO/SPUFI or QMF for
doing DB2/SQL development
|
|
10
|
|
|
11
|
- You will need the:
- Database name
- Host + Port number
- IP address if shared/network or mainframe DB2
- localhost if on your Windows machine
- User ID
- Password
- ¤Note that the connection
properties are installation and DBMS dependent:
- DB2 for z/OS requires a "Location" as well as Host name and
port number.
- You would work with your DBA and systems programmer to get these values
|
|
12
|
- On z/OS you will need to provide a few different pieces of information,
in order to connect:
- Location:
- Host:
- Do NOT check:
- Retrieve objects created
- by this user only
- UserID/Password:
|
|
13
|
- In this course the databases contain a few tables
- In your world, databases could easily contain:
- Tens of thousands of tables
- Thousands of Schemas
- To simplify working on your projects you should filter the available DB2
objects
- Two options:
- By Schemas (one or more checkboxes)
- With a "LIKE" expression
|
|
14
|
- In the DB2 mainframe world on z/OS databases could easily contain:
- Tens of thousands of tables
- Thousands of Schemas
- To simplify working on your projects filter the available DB2 objects
- Un-check: □ Disable Filter
- Enter: DDS0001
|
|
15
|
|
|
16
|
- The connection you create to DB2 is based on a default filter
for schema names, but you're not limited to that
at all.
- To re-filter your data objects:
- Select the connection
- Right-click and select Properties
- From Properties you can re-filter:
- Schema names
- Stored Procedures
- Tables
- Steps:
- Select the filter
- Un-check Disable filter
- Specify your new filter
- Click OK
|
|
17
|
|
|
18
|
|
|
19
|
|
|
20
|
|
|
21
|
|
|
22
|
- For tables with DB2-enabled "Referential Integrity"
- Select a table (either parent or child table)
- Note that the table should have constraints
- Right-click and select: Analyze
Impact…
- Select the type of analysis to perform
- Only children objects
- Only parent objects
- Both children/parent objects
- Click OK
- Read the Model report produced
- Dependent Object is the "child" table or view that will be
impacted
- "Impactor Object" is the parent table or view (of what has
been analyzed)
|
|
23
|
|
|
24
|
|
|
25
|
|
|
26
|
|
|
27
|
- A number of options are available for
managing,
controlling
and customizing the behavior of the
features in the
Data Perspective
- All available from:
|
|
28
|
|
|
29
|
|
|
30
|
|
|
31
|
|
|
32
|
- You can use the facilities of the Data Perspective creatively, to
benchmark different SQL designs.
Steps:
- Create a series of SQL statements
- Sandwich each SQL design between a SELECT of the current timestamp
(as shown)
- After you run your statement series use the timing data to determine the
"relative" performance results of each design
- Optionally –
copy the Result rows to an
external
file for analysis and "safe keeping"
|
|
33
|
|
|
34
|
|
|
35
|
|
|
36
|
|
|
37
|
|
|
38
|
|
|
39
|
|
|
40
|
- On z/OS you will need to provide a few different pieces of information,
in order to connect:
- Location:
- Host:
- zserveros.demos.ibm.com
- Port: 5446
- User name/Password:
- Your assigned UID/PWD
- Example:
|
|
41
|
- Recall:
- In the DB2 world on z/OS databases could easily contain:
- Tens of thousands of tables
- Thousands of Schemas
- To simplify working on your projects filter the available DB2 objects
- Un-check: □ Disable Filter
- Enter: DDS0001
|
|
42
|
|
|
43
|
|
|
44
|
|
|
45
|
- From this slide – copy and all of the commented SQL statements in the
Slide Notes
- From the Data Source Explorer:
- Click New SQL Script
- Paste the SQL Statements in the Script1.sql tab
- Un-comment any# of statements
- Right-click over the Content Area
- Select: Run SQL
- In the Results, for multiple statements you can expand and select one
at a time
- The Result1 tab shows data
- You will get some errors
- Optional – try other Context Menu selections like (for the sub-selects) Format
SQL
|
|
46
|
- From this slide's Notes, copy the COBOL program (name: CURSRAVG)
- From the z/OS Perspective:
- Create a new file under the \cobol\
folder in your project
- Paste the statements into the file and Save (do not Syntax Check)
- Select and Copy the Interactive portion of the SQL SELECT statement in
this paragraph – minus all of the embedded COBOL syntax (shown below in
the screen capture)
|
|
47
|
- Swap back over to the Data Perspective
- Either reuse your existing SQL Script, or create a New SQL Script using the
EGLDerbyR7 connection
- Paste the copied Cursor Declare inside the editor
- Right-click and select Run SQL
- Verify the results
|
|
48
|
- Now that you have completed this topic, you should be able to:
- Launch the Data Perspective
- Connect to a Data Source
- Use the Data Source Explorer to:
- View tables and relationships
- View sample table rows and values
- Edit (create, update, delete) row values
- Test interactive SQL
- Code/Build SQL statements
- Generate Table DDL
|
|
49
|
|
|
50
|
- From this URL: http://www.ibm.com/developerworks/downloads/im/udb/
- 1. Download and install UDB on your workstation
- 2. From RDz and the Data Perspective
- Create a new connection to the UDB SAMPLE Database
- See next slide for help with this
- Select and copy the SQL statements in the slide Notes
- Create a new SQL Script to the UDB SAMPLE Database
- Run the script against the SAMPLE Database
- Refresh the SAMPLE Database in the Explorer
|
|
51
|
- You will need the:
- Database name: SAMPLE
- Host + Port number è
- IP address if shared/network or mainframe DB2
- Note that the default port is: 50000
- localhost if on your Windows machine
- User ID
- Password
- Recommend that you save the password properties
|
|
52
|
- If you've successfully executed the SQL DDL against the UDB/SAMPLE
database you should get the relational objects described in this unit to
work with
- But note that the UDB/SAMPLE database comes with additional:
- Schemas
- Objects, including:
- Stored Procedures
- Additional tables/views/etc.
|
|
53
|
|
|
54
|
|
|
55
|
|