|
1
|
- Jon Sayles, IBM Software Group, Rational 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 IBMs 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:
- Russ Courtney/IBM
- Reginaldo Barosa/IBM
- David Bean/IBM-Rational
|
|
4
|
- Course Name: COBOL Foundation
Training - with RDz
- Course Description: Learn the
COBOL language, RDz and learn z/OS terms, concepts and development
skills in this course.
- Pre-requisites: Some experience in a 3rd or 4th Generation Language is
expected. SQL is also
recommended.
- Course Length: 10 days
- Topics (Agenda)
- Getting Started - installing and configuring RDz - and the course materials, and using Eclipse to edit
COBOL
- COBOL General Language Rules
- Basic COBOL Statements
- Data records and table handling
- Debugging Programs - Note: Deep dive on using RDz for common COBOL
programming errors (001, 0C4, 0C7, infinite loops, fall-thru, etc.)
- Input/Output and Report Writing Patterns
- Sequential File Match/Merge Patterns
- COBOL Subprograms and the Linkage Section
- Structured Programming Concepts and Coding Patterns
- Advanced Character Manipulation, COBOL Intrinsic Functions, Date and
Time coding patterns, and Language Environment calls
- OS/390 Concepts and JCL
- Compile/Link & Run Procs on the mainframe
- Indexed file Coding Patterns
- Sort/Merge and Master File Update Coding Patterns
- Accessing DB2 Data and Stored Procedures
- COBOL in the Real World:
- CICS - lecture only
- IMS (DL/I and TM) - ditto
- Batch processing - ditto
- Java calling COBOL
- COBOL and XML Statements
- SOA and COBOL - creating and calling Web Services
- Web 2.0 using Rich UI
|
|
5
|
- Audience
- This course is designed for application developers who have learned or
programmed in a 3rd or 4th generation language
and who need to 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.
- 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.
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
- After completing this unit, you should be able to:
- Using the Problem Determination Tools, Debug Option and RDz:
- Debug a mainframe batch job
- Compare and contrast mainframe debugging with local debugging (see
unit titled: RDz Workbench
Introduction)
- Discuss the Debug Option setup and configuration requirements
|
|
10
|
- Face facts: No one gets
it right the first time.
- Not at the production
code level.
- That's why IBM invented source-level application debuggers, so you can:
- See program execution, line-by-line
- Verify the value of a variable during program execution
- Stop and start program execution analysis, at the speed that our
procedural understanding of the application's execution flow can handle
|
|
11
|
- In a previous unit (RDz Workstation Introduction) you learned about
the RDz debugging capabilities:
- Debug Perspective
- Debug Views:
- Variables
- Monitors
- Breakpoints
- Etc.
- But what you did in that unit, applied to debugging local-COBOL
(Workstation-based) executables
- Now it's time (as promised) to see how to debug mainframe-COBOL
applications
|
|
12
|
- Specifically: IBM Debug Tool
- Green-screen (TSO-based) or RDz/Workstation-based interface to
z/OS-based debugging engines
- Debug:
- Online (CICS, or IMS TM)
- Batch
- Seamless debugging of mixed-language applications
- Interactive, source-level debugging in RDz with program running on z/OS
- Display, monitor and alter program variables
- Set standard types of breakpoints
- View data in Hex (EBCDIC) or string values
- Multiple configurable views
- Ability to make adjustments to the program while debugging
- Product web-site: http://www-01.ibm.com/software/awdtools/debugtool/
|
|
13
|
- The RDz remote debugger
- Client software that is installed with RDz on your workstation
- Communicates with the Debug Tool engine on the mainframe
- Note that Debug Tool must be installed on z/OS in order for you to do
the labs in this unit
|
|
14
|
- One debugging engine, with support for many environments:
|
|
15
|
- ώ RDz is started on your
workstation
- Ensure that your compile proc has the necessary TEST parameter, and
Compile/Link to create load module
- Discover workstation TCP/IP parameters:
- TCP/IP Address
- Listener port#
- Enter TCP/IP address of workstation in run JCL for Debug Tool DD
statement, and Submit the JCL
- Debug the application
|
|
16
|
- Use the TEST compiler option to prepare your executable COBOL program
for use with the debugger.
- The TEST option is required for remote debugging.
- The TEST option produces symbol and statement information that enables
the debugger to perform symbolic source-level debugging.
- The TEST option is set in the PROCs distributed with RDz (see screen
capture)
- If you are not using the IBM/RDz PROCs for
building
your applications, be sure to override the compiler
option and
add TEST - as shown θ
|
|
17
|
- Open the Debug Perspective
- Click the small downward pointing triangle next to the debug-daemon
icon
- Note the Port#
- Select: Get Workstation IP
- Copy the IP address
|
|
18
|
- Configure your application to start Debug Tool by including a specific
DD card in the run JCL that includes your workstation's current Port#
and TCP/IP address
- This is an example of JCL to run a batch job
- The CEEOPTS DD statement is the easiest way to start the Debug Tool for
batch applications
- Code as shown
|
|
19
|
- Debug Tool will interface with RDz and throw the Confirm Perspective
Switch prompt
- Additionally, if (but only if) your mainframe source code is out sync
with the Load Module you'll get an informational prompt
|
|
20
|
- Debug Perspective is launched in RDz
- Same debugging features as Local COBOL Debug (from previous course unit)
- Your source is copied down from z/OS to your RDz workstation
- Execution is on z/OS
|
|
21
|
- Notes:
- - Same views, options and
debugging features as Local COBOL Debugger
- - However, application
execution happening on z/OS
- - Only interactive debug:
view/browse activity occurs on the Workstation
|
|
22
|
|
|
23
|
- Shows same + additional debugging functionality as icons on toolbar
- However, not all Run menu functionality enabled for COBOL/PL1
- Also shows hot-keys
- Context-sensitive:
- Options are grayed in current debug session if not applicable
|
|
24
|
- A statement breakpoint will stop the program when it reaches a statement
- It stops before the statement runs
- A breakpoint can optionally be made conditional
- A simple condition may be specified such as:
- VariableX > 999
- or
- VariableY = 'Abc'
- A breakpoint can be based on a frequency
- Stop the Nth time a statement runs
|
|
25
|
|
|
26
|
|
|
27
|
- Can have breakpoints occur conditionally, when:
- The value in a field changes
- Some portion (# of bytes) of a field changes
- A simple condition tests true for the value in the field
- Steps:
- Select a variable
- Right-click, and select: Add Watch Breakpoint
- Select Number of bytes to watch
or add a simple condition
- Specify Auto to test for all bytes
|
|
28
|
|
|
29
|
|
|
30
|
|
|
31
|
|
|
32
|
|
|
33
|
|
|
34
|
|
|
35
|
|
|
36
|
- Debug Tool can receive control back from the system after an abend
occurs
- The program will be stopped at the abending statement
- You can:
- Allow the application to abend and terminate
- Capture abend info with a product such as Fault Analyzer
- Terminate the application and prevent further processing
- Or continue running the program
- Usage note:
- The LE TRAP(ON) option must be active
|
|
37
|
- There are several options for terminating your application:
- Remain in the debugger, and RESUME until the program runs to completion
- The program will terminate normally or with an abend
- The return code is controlled by the program
- Disconnect the debugger, and allow the program to run to completion
- The program will terminate normally or with an abend
- The return code is controlled by the program
|
|
38
|
|
|
39
|
|
|
40
|
- For batch debugging
- If your submitted JCL is still in the code (Content) area
- No need to return to the z/OS Projects perspective
- Right-click
- Select: Submit
- !Note that F11 (or Debug
from the Run menu) does NOT work as it did with Local COBOL debugging
|
|
41
|
- Having completed this unit, you should now be able to:
- Describe where the debug engines are located
- Show how to set the workbench preferences for running and debugging
- Show how to invoke the debugger for local programs
- Describe the views of the Debug perspective
- Demonstrate how to set breakpoints in COBOL code
- Explain how to set up the COBOL compile options for remote debugging
- Show how to debug a remote batch COBOL program
|
|
42
|
|
|
43
|
- After completing this unit, you should be able to:
- Using the Problem Determination Tools, Debug Option and RDz:
- Debug a mainframe online transaction
- Describe the online transaction features for configuring your 3270
sessions with Debug Option
- Debug a CICS 3270 Application
|
|
44
|
- Guess what? No
one gets it
right the first time
coding online
programs either J
- Lucky for you:
- Debug tool handles:
- CICS 3270 online transactions
- IMS TM online transactions
- Without any different debugging techniques
- The only difference from batch is the debug setup procedure for the
online environment
|
|
45
|
- ώ RDz is started on your
workstation
- Ensure that your compile proc has the necessary TEST parameter, and
Compile/Link to create load module and that your CICS application is
setup for Debug Option testing
- Discover workstation TCP/IP parameters:
- TCP/IP Address
- Listener port#
- Access and login to your CICS region
- Execute the DTCN transaction and specify:
- Terminal ID
- Programs to put under Debug control
- User-ID
- TCP/IP parameters:
- Save the DTCN transaction specification
- Debug your CICS application
|
|
46
|
- Use the TEST compiler option to prepare your executable COBOL program
for use with the debugger.
- The TEST option is required for remote debugging.
- The TEST option produces symbol and statement information that enables
the debugger to perform symbolic source-level debugging.
- The TEST option is set in the PROCs distributed with RDz (see screen
capture)
- If you are not using the IBM/RDz PROCs for
building
your applications, be sure to override the compiler
option and
add TEST - as shown θ
|
|
47
|
- Open the Debug Perspective
- Click the small downward pointing triangle next to the debug-daemon
icon
- Note the Port#
- Select: Get Workstation IP
- Copy the IP address
- Either paste the IP address into Notepad, or write it down
|
|
48
|
- From Remote Systems Explorer:
- Right-click
- Select: Host Connection Emulator
- Select your CICS application
- Enter your Userid and Password and sign in
|
|
49
|
- From CICS (after signing in):
- Clear the screen
- Enter: DTCN and press 8 Enter
- From the DTCN screen
- Press F10 this will fill in the Terminal Id for your workstation
|
|
50
|
- DTCN transaction data entry screen
- Enter the Tran-code
- Enter up to eight specific Program
Id(s) you wish
to debug through
or
- Enter wildcard text
for the Program Id(s)
- Enter your User-ID
- Session Type: TCP
- Port Number:
from your Debugger look-up
- Display ID:
Your TCP/IP address, from your Debugger look-up
(note that you can not paste into this 3270, screen)
- Press F4 to save your debug profile
- Press F3 to clear the screen
|
|
51
|
- From the CICS region
- Enter the Tran-code
- Press 8 Enter
- Click: Yes at the Confirm Perspective Switch
|
|
52
|
- Debug as previously learned in the batch/remote and Local debug units.
|
|
53
|
|
|
54
|
- If your current transaction ends, and a BMS or 3270 screen is sent:
- You will be notified (prompted) by the debug engine
- If a screen is sent, the 3270 will display in the content area
|
|
55
|
- You can resize the screen portion of the debugger
- And use the PF-Key emulation options in the Host Connection
|
|
56
|
|
|
57
|
- After having completed this unit, you now should be able to:
- Using the Problem Determination Tools, Debug Option and RDz:
- Debug a mainframe online transaction
- Describe the online transaction features for configuring your 3270
sessions with Debug Option
- Debug a CICS 3270 Application
|