|
1
|
- Jon Sayles, IBM/Rational Software Group, 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:
- David Myers/IBM
- Bill Klein
- Reginaldo Barosa
- Mike Wrzinski/Sentry Insurance
- Venkatuday M Balabhadrapatruni/IBM
- Howard Chen/asiEGL
- Alisande Reeves/CapGemini
- Rick Anderson and Asish Toomuluru/BNSF
|
|
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 (RDz) 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
- Dataset 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
|
|
|
7
|
- After completing this topic, you should be able to:
- Describe the foundation Eclipse terms and vocabulary:
- View
- Perspective
- Menus
- Context menu
- Toolbar menus
- Work with Views:
- Define "view"
- Maximize/Minimize/Open/Close/resize different workbench views
- Work with Perspectives:
- Define "perspective"
- Switch perspectives
- Reset (to their installation defaults)
- Access the help system
|
|
8
|
- Notes:
- You may go through the following topics in this unit either as "follow-on
by trying the examples shown in the slides" – workshops, or by
simply reading for understanding, then doing the workshop at the end of
the section.
- Your workbench state (the way RDz appears after you launch it) will not
look exactly like the screen captures in 100% of these slides
- This is okay as we need to describe the use of RDz within different
contexts, and what is important for you to get comfortable with, are:
- Terms, concepts and vocabulary
- Navigation
- Editing functionality and the RDz functionality
|
|
9
|
- To start RDz, after successful installation either:
- Use the Windows start menu
- Or – if you copied a link on to your desktop, click the link
- You will be prompted to select a Workspace
- The default installation workspace is on the C:\ drive, but you may have
customized its location on your desktop
|
|
10
|
- The RDz Workbench is the software that enables you to create, test,
modify, manage, run and deploy your COBOL applications
- It organizes and maintains your software development resources
- It provides access to tools like editors, design tools, compilers and folders for managing
your application resources
|
|
11
|
- RDz uses as its Integrated Development Environment an open-source
programming platform known as “eclipse” - http://www.eclipse.org/
- Eclipse is a development platform that provides a graphical development
environment that we'll be calling the RDz Workbench
- If you're a mainframe ISPF programmer, instead of exclusively typing in
code and commands, you’ll type, 7 but also use your 8 mouse to:
- Drag & Drop files – from the mainframe to your workstation and back
- Do certain COBOL development activities – especially ones that pertain
to program maintenance and analysis
- Manage (Open, Close, Create, Delete, Rename, Refactor, Move) files
- Kick off mainframe program compiles and batch jobs - and view the results
- “Paint” screens – develop CICS/BMS and IMS/MFS
- The Eclipse graphical software development idiom is a proven
productivity enhancement over keyboard-only-development. Although, we
will grant, that if you’re a dyed-in-the-wool ISPF-veteran, RDz will
appear very different from green-screen technology.
- However, you will soon find that:
- For almost every development facility on the mainframe there is
corresponding RDz functionality
- With a little practice you can become far more productive with RDz
- Consider – how often do you open a Windows DOS command prompt to type
in commands that: create, copy, delete, organize and manage the files on your PC?
|
|
12
|
- You will work with a variety of
COBOL resources: programs, copybooks, compile listings, executables,
data files and so forth
- Using RDz you store, organize and
manage the resources associated with your projects in a Workspace.
- After you launch RDz and select a
Workspace (3 slides back), you have access to all the files and folders
inside the Workspace – typically organized in one or more projects.
- & Workspace resources
are organized into
|
|
13
|
- Workspace projects organize and manage related application resources.
And projects within a workspace can be organized by:
- Batch application .. vs.. Online applications
- Lines of business/departmental applications: Accounts Payable,
Inventory, Claims, Manufacturing Part Assembly, etc.
- Common – or shared projects, which might consist of data and record
definitions that are used across multiple projects
- There are also a number of
specific RDz project types that we will learn about as we go through the
course, such as z/OS Local Projects, MVS Subprojects, etc.
- Projects also contain and are
governed by build configuration files, known as property files** which
specify generation options for your project components
- Projects may be further divided
into folders
- z/OS COBOL Projects typically
contain the following high-level folders:
|
|
14
|
- \cobol\ is the default folder that is the highest level folder within a
given project in your workspace, under which COBOL program resources are
organized.
- These COBOL resources include:
- Sub-Folders – in case you'd like to further refine and break-down the
organization of large projects
- 1cobol
- 1batch
- program1.cbl
- program2.cbl
- …
- 1online
- Or in our case, just all COBOL files:
- 1cobol
- program1.cbl
- program2.cbl
- …
- ! By default, COBOL files
should end with one of the following file-name extensions: .cbl, .cob, .cobol
|
|
15
|
- \BuildOutput\ is the default folder that is the highest level folder
under which all of your compiled COBOL resources are stored inside a
project.
- These resources include:
- .OBJ – object modules
- .exe – COBOL executables – suitable for running or debugging
- .adt – an internal-system file used by RDz when you do source-level
debugging produced by a Compiler Directive)
- .lst – listing file č
- - Shows highest error condition
- - Sorted XRef of COBOL variables
- - Other program info
|
|
16
|
- Where (under what folder and/or sub-folder) in your project would you
look for the following files?
- StartApp.OBJ _______________
- StartApp.cbl _______________
- StartApp.exe _______________
- myCopy.cpy _______________
- StartApp.lst _______________
- True/False – all COBOL source
files (each and every one) will:
- a. End with an extension of .COBOL
- b. Be organized and exist
under the \COBOL\ folder – or a sub-folder under the
- \cobol\ folder in your project
- & Note – if you do not
know what these file types are, do not worry, we will be covering them
and their use a bit later in the course.
|
|
17
|
- RDz's menu system adheres to industry standards. It is intuitive and easy to learn and
navigate – especially if you've used a graphical IDE before.
|
|
18
|
- Workbench tools are arranged in small tabbed areas called “Views”
- Views are windows which display file or project information or which provide access to
RDz functionality
- Development tasks can require you to work with tools from several different Views:
- Code editing
- Navigation tools
- Program testing
- Remote System file management
|
|
19
|
- Out of the dozens of Workbench views available in RDz, there are only a
handful you need to learn to get going and become productive:
- Remote Systems View
- z/OS Projects View
- COBOL Source Editor
- Properties View
- Outline View
- Remote Error List View
- Perform Hierarchy View
- Note that the word "view" is often dropped when discussing
RDz. You can say
- "From z/OS Projects" or "From the z/OS Projects View"
- "From Properties" or "From the Properties View"
|
|
20
|
- Organizes your mainframe projects, and allows you to:
- Create and manage mainframe resources:
- QSAM/VSAM files, and PDS/PDSE data sets
- PDS members
- Create “like” – with same dataset attributes
- Delete, Move and Rename
- Open mainframe files in the RDz editor
- Generate JCL for COBOL programs
- Perform sophisticated search
operations
- Show file dependencies:
- Copy file and Includes
- Called subroutines
- Develop Web Service functionality
- Do file compares or source history replace operations
- Run mainframe syntax checks on programs, using the z/OS compiler
- Â Note – this View requires
you to specify a z/OS Connection, something we will discuss later in the
course
|
|
21
|
- By Right-clicking over a resource
in the Remote Systems View you access a “Context Menu” that provides
these options
- By double-clicking over a
resource in the Remote Systems View you open that resource in the COBOL
Editor
- We will not spend any time in the
Remote Systems Explorer right now, and will come back to this view,
in-depth, when we begin the mainframe portion of the class
|
|
22
|
- A context-dependent View that provides statistics (like file statistics
on your PC or ISPF 3.1 Data Set statistics)
- Example:
- List data set properties on the host for:
- We will come back to this view, in-depth, when we start the z/OS portion
of the class
|
|
23
|
- Organizes your projects, and allows you to:
- Create new resources:
- COBOL programs, services, etc.
- Copy files
- Open COBOL files in the editor
- Manipulate files:
- Run COBOL programs
- Debug COBOL programs
- Rebuild (compile) the project
- Refactor
- When “A” is changed change related “B” resources
- Set project-level properties
- Specify entry-points, in PC
applications
|
|
24
|
- 8 Right-clicking over a
resource in the z/OS Projects accesses a “Context Menu” that
provides options related to the
resource "in
focus"
- Double-clicking a resource in z/OS Projects opens that resource in
the Editor mapped to that file
type:
- BMS/MFS
- COBOL
- JCL
- PL/I
- Etc.
|
|
25
|
|
|
26
|
|
|
27
|
- Provides a consolidated, navigate-able list of your program’s:
- Copybooks
- Paragraphs
- Variables
- Other COBOL resources
- Especially useful for:
- Analyzing and studying programs you did not write
- Browsing through large source files and selecting "elements of
interest"
- Top-Down code analysis
(i.e. Learning – or getting the gist of a large COBOL program
quickly)
- The Outline View and the source code editor are synchronized:
- Select an Outline View entry
- The line of code corresponding to that entry is selected in the
editor
- Select a line of code in the Editor
- The Outline view will shift to select the associated area of your
program
|
|
28
|
|
|
29
|
- Allows you to see syntax or structural problems in your application.
- By double-clicking on a problem, the file in question is opened in the
COBOL Editor, and your mouse is positioned to the line in doubt
- Note that you can also mouse-over the Red-X in the Editor Area, and learn more
about the syntax error
|
|
30
|
|
|
31
|
- Enable as follows:
- (from the menu on the top): Window
- Show View
- Other…
- Expand COBOL
- Select: Perform Hierarchy
- After successful Local Syntax Check:
- Select a COBOL paragraph or section
- Right-click and from the Context Menu, select: Open Perform Hierarchy
- Nests (indents) the Perform chain in the view č
- Navigate through the Perform Hierarchy view and note
the synchronization with the
source code:
- Select a Paragraph label in the Perform Hierarchy view
- The Perform statement for that entry is selected in the COBOL Source
Editor
|
|
32
|
- After a successful Local Syntax Check of test1.cbl
- Select 200-PROCESS-RECORDS
- Right-click and from the Context Menu, select: Open Perform Hierarchy
- Navigate through the Procedure Division using the Perform Hierarchy
view
- Select a Paragraph label in the Perform Hierarchy view
- The Perform statement for that entry is selected in the COBOL Source
Editor
|
|
33
|
- What's a Bookmark?
- Bookmarks are tags that allow you to quickly find specific lines of
source in your program.
- Use them as reminders (electronic "sticky pads")
- Enable as follows (from an edit session)
- Right click in the left-hand border, next to the line you want the
Bookmark on
- - Select: Add Bookmark…
- - (optionally) Overtype the name of the Bookmark
- - Click OK
- A small vertical book icon appears in the border č
- To clear a Bookmark:
- Right-click over an existing Bookmark
- Select Remove Bookmark
- To see your Bookmarks open the Bookmark View
- Open the Windows Menu
- Select Show View
- Bookmarks
|
|
34
|
- What's a Task?
- Tasks are "Bookmarks on steroids". In addition to tagging lines they
allow you to:
- Set a task priority
- Specify task completion
- Enable as follows (from an edit session)
- Right click in the left-hand border, next to the line you want the Task
on
- - Select: Add Task…
- - (optionally) Overtype or add text in the Task Description
- - Select a task Priority
- - Check if the task is complete
|
|
35
|
- To see your Tasks in the Tasks View
- Open the Windows Menu
- Select Show View
- Tasks
- From this View you can:
- - Navigate to specific Tasks
- - ţCheck/un-Check Task
completion
- - Re-sort the Tasks in the view
- - Select and work with Tasks en masse
|
|
36
|
- Bookmarks View - With test1.cbl open in the editor – do the following:
- Set two or three Bookmarks throughout the program (overtype the default
name on at least one Bookmark)
- Navigate to the Bookmark using the green rectangle in the right-hand
border of the editor
- Open the Bookmark View – and:
- View your Bookmarks
- Navigate to Bookmarked lines
- Delete all of your Bookmarks
- Tasks View - With test1.cbl open in the editor:
- Set three or four Tasks throughout the program (overtype the default
name on at least one Task)
- Navigate to the Tasks using the green rectangle in the right-hand
border of the editor
- Open the Tasks View – and:
- View your Tasks
- Modify the Task Description
- Set certain Tasks status to complete
- Navigate to the Task lines
- Sort the list by Priority
- Sort the list by Complete/not complete
- (OPTIONAL) Select all of the Task information – Copy the Tasks and
paste into rows of an Excel spreadsheet
- Delete the Completed tasks
- Delete the remainder of your Tasks – en masse (using the Context Menu)
|
|
37
|
- You can Maximize a view by double-clicking in the middle of the View Tab
(and Restore the view back, by doing the same)
- You can Close a view (inadvertently or on purpose) – by clicking the X
- To close a program you are editing:
- Click the close icon, on the tab
- Alternatively you can close an edit session by pressing
- Ctrl + 0 (zero) …or…
- Ctrl + F4
|
|
38
|
- Experiment with Workbench Views – to get comfortable manipulating them
and their contents
- Maximize, and Restore an editor view of one of your programs, or of the
Outline or Properties View.
- Close the Outline View
- From the Window menu reopen the Outline view by selecting:
- Open several programs
- Right-click over the tab, and select:
|
|
39
|
- & Perspectives organize
views into groupings designed for particular roles and oriented to doing
specific tasks in a productive way
- There are only a few perspectives
you will use in this course:
- z/OS Perspective
- Used for creating and testing COBOL and PL/I applications
- Debug Perspective
- Used to debug COBOL and PL/I applications
- Data Perspective
- Used to view relational data and run SQL interactively
|
|
40
|
- You will spend most of your time
in the z/OS Projects Perspective.
It has default views optimized for COBOL programming, data set
and file management, accessing host and local development resources.
|
|
41
|
|
|
42
|
|
|
43
|
- Options:
- Open Perspective
- From your current workbench perspective, open a new perspective
with its default views and tools
- Reset Perspective
- Return to the RDz installation defaults, for a perspective
- Close Perspective
- Close a perspective if no longer needed for your work at the moment
- Customize and save a perspective
- When you have used the Workbench for awhile, you may want to create
your own custom perspectives, with customized views and tools, etc.
- All "in-use" perspectives can be switched back and forth from
an icon at the
top-right corner of your Workbench which shows the perspectives
|
|
44
|
- The Preferences dialog (under the Windows menu) allows you to customize your Workspace
development environment.
- You will use the dialogs and entries in this area for quite
a few important
z/OS COBOL development
activities
throughout the course:
- Customizing the editor
- Specifying Database Connection
information
- Entering JCL JOB card information
- More…
|
|
45
|
- From the Text Editors option you can set global editing characteristics
for your work:
- Recommendations
- Enable by checking:
- (For mainframe ISPF developers)
- Disable by un-checking:
- Enable drag and drop of text (see notes)
|
|
46
|
- You might wish to customize your editor colors. You can do this from: Preferences >
- LPEX Editor
- Appearance and Parser Styles sub-options.
|
|
47
|
- : Open the Windows menu and
select Preferences
- Expand:
- Click: User Key Actions
- (from the bottom part of the tab) Enter the following:
- Key: f5
- From Action, select: CobolOpenDecl
- Click Set
- Click OK
|
|
48
|
- : From z/OS Project Explorer
- Double-click: PrintApp.cbl
- To load the source into the editor č
- Scroll down – to the end of file
- Double-Click (to select): Out-Name
- Press: F5
- Your cursor should jump to the field's declaration, in the COBOL DATA DIVISION
|
|
49
|
- Two Approaches:
- Use COBOL program templates ***Preferred
- Start with a new file – and name with .cbl extension
- We'll begin showing you the .cbl extension approach
- Creating a new file (named with a .cbl extension) – steps:
- Set focus to the project/folder
- Right-click and select:
- Name the file
- Click: Finish
- You're ready to
enter your COBOL
statements
|
|
50
|
- Templates:
- Allow you to create standards-based, code-reuse libraries of different
kinds of pre-configured statements, snippets, etc.
- Available from (menu):
- Window
- Preferences
- COBOL
- Code Templates
- Can:
- Select and customize
any program area
- Export:
- A single (selected) template
- All of your templates
- Import templates
|
|
51
|
- From the RDz menu system, select:
- File > New > Other… > COBOL > COBOL program
- Click Next>
- Name the file
- <name>
- (No need to type the
extension)
- And enter the Author name and Target
- Click: Next>
- Select which Project/Folder to create the file within
- Click: Next>
- If your program is going access: CICS or SQL databases check the
appropriate options č
- If you select these options, there is another wizard
you can access to further customize the default code snippets
- Click: Finish
- You're ready to enter your COBOL statements
|
|
52
|
- You will use two different development techniques with the Workbench:
- 1. 7 Type COBOL statements
(business logic) using the COBOL Editor, and sometimes type other short
properties in Workbench dialogs and fields. This is no different from programming
in any other toolset or language
- 2. 8 Navigate through the
Workbench, and do “drag & drop” development (with your mouse). If you’re new to drag & drop
development here are some hints.
|
|
53
|
|
|
54
|
|
|
55
|
- : Do the following:
- Launch RDz and select your workspace
- Find (by opening folders in z/OS Projects and opening files in the
Editor Area) and describe the contents of the following resources (files):
- Printapp.lst
- Startapp.lst
- Startapp.cbl
- Double-Click: Startapp.exe –
follow the on-screen instructions, and finish the run by
entering: Q
- Click (set focus to … select or choose) each of the three open files
- Make the files in the Editor Area full-screen, then size them back
down
- Do this several times (get comfortable with this, it's a key to your
productivity)
- Close the files in the Editor Area
- Close an individual file
- Close all files at once (using a single mouse-click)
- 3. Find and close the Outline view then re-open the Outline view
- 4. From z/OS Projects Explorer – explore your first z/OS Project
- Open and close several of the folders: cobol and BuildOutput
|
|
56
|
- : Do a bit more test
driving:
- 5. From the RDz/Eclipse Menu System – find (locate or navigate to) the
following: (Note: Cancel after
you've arrived at each of these destinations):
- File menu > New >
Other > Examples
- File menu > Import >
General > File System
- Edit menu (Glance at each of the Edit menu options )
- Search menu (Again, just get an idea about the Search menu options )
- Window menu
- Show View > Other > COBOL Perform Hierarchy
- Show View > General > Book Marks
- Show View > General > Tasks
- Help menu > Samples > Tours >
- Rational Developer for System z User Assistance Features
- Click the above link, and listen to some of the narrative
- 6. From the Window menu, open the Debug Perspective
- Using the icons (top right hand corner of Workbench) switch from the
Debug to the z/OS Perspective
- Close the Debug perspective
- Reset your “current” (should be the z/OS) Perspective
- Close any open files in the Workbench
|
|
57
|
- From Preferences, modify the default COBOL templates. Add a comment "flower box"
as follows:
- Select Program Comment
- Click Edit…
- Enter COBOL comments – space over 6X to start each * in column 7
- Note that you can feel free to embellish – adding your company name,
etc. And optionally add ID and
Procedure Division comments
- Press OK
- Following the steps on the prior slide (3 of 4) create a new COBOL
program using your modified Template in your project's cobol
folder. Name it anything you'd
like (but a valid COBOL name)
|
|
58
|
- Now that you have completed this unit, you should have:
- Navigated the eclipse IDE,
- Opened project folders and files
- Set Workspace properties
- Defined and used the following eclipse views and perspectives:
- Views
- Editor Area
- z/OS Project Explorer
- Outline
- Remote Systems
- Remote Error List
- Properties
- Window/Preferences/Capabilities
- Perspectives
|
|
59
|
|
|
60
|
- After completing this topic, you should be able to:
- Contrast and compare the two different RDz COBOL source editors
- List the features of the ISPF editor, and point out the
LPEX-equivalent editing function
- Set your preferences to choose one editor vs. another
- List the standard (common) COBOL source-editing techniques, and perform
them using either of the RDz editors
- Customize the LPEX editor and extend its functionality
|
|
61
|
- RDz provides different editors for developing applications:
- LPEX Editor – a high-end, graphical editor with features specific to
mainframe development requirements
- ISPF Editor – an emulation of IBM's mainframe editor, integrated into
the RDz/Eclipse Workbench
- Both provide the common editing requirements:
- Insert/Delete/Copy/Paste/Repeat/Find/Change
- Command line editing options
- Extensive list of Hot-Key combinations for short-cut editing (ex.
Ctrl+S = save, Ctrl+D= repeat
line, etc.)
- Both have context-sensitive features:
- File-type-sensitive source columns and tabs (i.e. JCL ..vs.. COBOL and
PL/I)
- File-type-sensitive context menu options
- LPEX oriented towards mouse-based, graphical editing techniques
- ISPF is oriented towards line-based/mainframe style editing
- Your choice
- But, if you're a mainframe-veteran, don't just bail on the LPEX editor J
- It's more extensible
- And in-line with all contemporary editing products and tools
- We will learn how to use both of these editors, and start out, by seeing
what features are common…
|
|
62
|
|
|
63
|
- You will want to work in both normal and full-screen mode, while doing
COBOL development
- Normal-screen mode gives you access to:
- Your code
- The Context Menu
- All of the tools in the various RDz Workbench Views:
- Outline view
- Perform hierarchy
- Many others
- Full-screen permits access to the Context menu, while allowing you to
see and work on much more code at-a-glance
- The number of lines depends on your screen resolution:
- 1024 X 768 – 31 lines
- 1280 X 1024 – 46 lines
- 1600 X 1200 – 60 lines
- You can also split screen vertically to access a LOT more code
at-a-glance
- Note the vertical lines marking the A and B margins
|
|
64
|
- These margins are optional, but if you like them enable as follows:
- From Preferences, expand:
- LPEX Editor >
- System z LPEX Editor >
- COBOL Parser
- - Check the three boxes shown below
- - Click OK
|
|
65
|
- To see the declaration of a variable, paragraph or section name:
- Move your mouse-pointer over the identifier – and just hover
- Notes:
- You can hover anywhere (not just on the "current line")
- Hover works even if the
declarations are contained in a copybook (although
you have to
configure the
SYSLIB property in your project)
|
|
66
|
- If you d or move program lines during edit, the place where the lines
were originally is marked by a small thin rectangle in the edit border.
- You can mouse-over the rectangle to see the original statement(s)
- Notes:
- Ctrl+Z can un-do edit operations
- Once you save (Ctrl+S) your source, the deleted/moved lines markers are
gone
|
|
67
|
- The Outline View allows you to collapse and expand program:
- Divisions
- Sections
- Paragraphs
- Group-level data items
- Very useful for:
- Understanding or visualizing the structure of a program
- Navigating within a program
|
|
68
|
- Validation Markers
- When the COBOL Validator does not understand what you've coded, a yellow
warning triangle appears in the prefix column on the far left of the
editor
- If you mouse over the column you can get context-specific language
coding "hints"
- You can enable/disable Validation from the Preferences menu
|
|
69
|
- Optional workshop:
- With StartApp.cbl open in the editor
- Scroll to line 53
- Change the until to unti
- Move the cursor to see the yellow syntax validation triangle
- Move your cursor directly over the validation triangle to view the
validation message text
- Then correct unti back to until
- Note that the validation triangle disappears
- If time permits find out what else validation works for:
- Misspell variable name references inside the Procedure Division
- (in test1.cbl) misspell paragraph names in PERFORM statements
- Do not save your changes
|
|
70
|
- Content Assist allows you to code statements by selecting values from a
list after typing partial text and pressing:
- Ctrl+Spacebar
- The process:
- Partially type a:
- COBOL keyword
- Variable (including 88-level)
- Paragraph name
- Move your cursor immediately at the end of the text you wish to use
Content Assist to complete
- "immediately" = the very next byte after the text
- Press Ctrl + Spacebar
- Select the completion identifier from the list – which is sorted
alphabetically within type
- Benefits:
- Improves productivity
- Reduces typos and syntax errors
- Particularly helpful with lengthy COBOL identifiers
- Long paragraph and variable names
- Qualified variable names
|
|
71
|
- Refactor the 300-WRAP-UP paragraph in test1.cbl using Content Assist –
and move the file close statement into a new Performed paragraph.
- Type in a new Paragraph name at the end of the program
- Enter a new blank line below the
paragraph name
- Type: cl and press Ctrl+Spacebar
- Use content assist to select both file names (one at a time)
- Add a period at the end of the CLOSE statement
- Enter a blank line in place of the current CLOSE statement in
300-WRAP-UP
- Use Content Assist to select:
- 7a. PERFORM
- 7b. Your new paragraph name
- When finished:
- Save your changes and using the Context Menu do a Local Syntax
Check. Remove any syntax errors
|
|
72
|
- Both the LPEX and ISPF editors provide an extensive collection of
hot-keys or keystroke shortcuts
- Show complete list by pressing: Ctrl+Shift+L
č
- Black entries are activated
- Gray are unavailable in the current editing context
- Entries are case-IN-sensitive
|
|
73
|
- Ctrl+Home – top of file
- Ctrl+End – bottom of file
- Ctrl+L (or Esc) – places your cursor inside the LPEX Command Line –
where you can:
- Type in a line #:
- Press 8 Enter
|
|
74
|
- Load test1.cbl into the editor
- Do the following:
- Press: Ctrl+L
- Type: 77
- Press: Enter
- Press: Ctrl+T
- Press: Ctrl+2
- Close the additional source view
- Press: Ctrl+End
- Press: Ctrl+Home
- What do the following hot-key combinations do?
- Position your cursor at the beginning of any line with COBOL source and
press: Shift+End
- Position your cursor at the end (to the right) of any line with COBOL
source and press: Shift+Home
- Press: Ctrl+Shift+L
|
|
75
|
- Both the LPEX and ISPF editors provide a powerful set of editing tools
from a Context Menu, which is activated using the right-mouse button –
and is meaningful "in the context" of something you've
selected in your code, or something you are doing with RDz (i.e.
selecting a file from the z/OS Project Explorer)
- Options exist for:
- Text editing
- Copy/Cut/Paste selected lines
- Comment/Uncomment selected lines
- Refactor (rename) paragraphs, sections or variables
- Running and Debugging programs
- Filtering out areas of your source, to view specific elements
- Submitting JCL (if you're editing a JCL file)
- Syntax checking your source locally or remotely (on z/OS)
- Opening and browsing copy members
- Comparing and replacing changed versions of your code with "local
history" – copies of your source maintained during your edit
session
- Opening (jumping to) a paragraph or variable declaration
- Viewing the Perform chain of a program
- All of these options can be useful, and when worked into your editing
repertoire, can improve your development productivity.
|
|
76
|
- Often, you will be editing code in the PROCEDURE DIVISION and need to
verify something about a specific declaration:
- Variable, Paragraph or Section
- Besides hover, the easiest way to jump to the declaration is to:
- Set the cursor-focus in the variable, paragraph or section identifier
- Right-click
- Select: Open Declaration
- "Jump" back to the line you started from, by clicking the
back arrow
on the menu bar
- Notes:
- This feature works, even if the declaration you are opening is in a
Copybook or Include
- The bigger and more complex the program – the more you will use Open
Declaration
- If you finished the workshop at the end of the last topic, F5 should
also open the declaration
|
|
77
|
- 1. Load test1.cbl into the editor
- Go to line 74 – or whatever line shows: PERFORM 300-WRAP-UP
- Double-click and select: 300-WRAP-UP
- Press F3 – or use the Context Menu č
- 2. From within the 300-WRAP-UP paragraph
- Double-click and select: CTR-STUDENTS
- Press F3 – or use the Context Menu č
- 3. Click the back arrow (in the menu bar) several times
to back-trace your steps
|
|
78
|
- Similarly, you may want to open a Copybook or Include file from within a
program:
- Set your mouse-focus inside the variable
- Right-Click
- Select: Open Copy Member
|
|
79
|
- Shows the copybook/include file "build dependencies" necessary
for your COBOL program to compile successfully
- From z/OS Project
- Right-Click over the file you want to run the report against
- Select: Show Dependencies…
|
|
80
|
- Copybook and Include files are found by RDz searching in a SYSLIB
property – a project attribute set by doing the following:
- From the Window menu:
- Show View > z/OS Project Views >
Property Group Manager
- From the Property Group Manager View
- Expand LOCAL
- Right-click COBOL Sample Property Group, select: Edit…
|
|
81
|
- From the z/OS Project explorer, create a new folder named copy, in the chapter1
project
- Following the five steps (on this and the previous slide) enable your
chapter1 project for copybooks by setting the SYSLIB property to your
copy folder, under chapter1 (remember, that SYSLIB is case-sensitive)
- From Windows – create the copybook source file in your SYSLIB directory
- Open Notepad
- Select and copy (Ctrl+C) all of the COBOL 01-record statement
declaration code in the Slide Notes
- Paste the code into Notepad (Ctrl+V)
- Save the Notepad file as a plain ASCII text file named: cobtable.cpy
- – in the folder:
drive:\Workspace\chapter1\copy\
- (note that drive:\Workspace
will be different on your machine)
|
|
82
|
- 4. From the slide notes – select
all (Ctrl+A) then copy (Ctrl+C) the large COBOL program source file
- 5. From Project Explorer – Create
a new file under the \cobol\
folder, named: cntrlbrk.cbl
- 6. Paste the copied source code
into this new file – starting at line1/position 1
- 7. Save (Ctrl+S) your new COBOL
program
- 8. Experiment with all of the Copybook development techniques discussed
– starting from five slides prior in this unit:
- With cntrlbrk.cbl loaded into the editor: find the copy statement in
the program source
- Press: Ctrl+F
- Type copy in the find area and press <Enter>
- Double-click (to select) cobtable
- Right-click and from the Context Menu, select the options to:
- Browse Copy Member
- Open Copy Member
- Close the copybook
- Find a copybook variable in the Procedure Division:
- Ctrl+F
- Type CUSTOMER-NAME in the find
area and press <Enter>
- Double-click to select CUSTOMER-NAME
- Right-click and from the Context Menu select: Open Declaration
- Close the copybook
- From z/OS Project Explorer:
- Right-click over cntrlbrk.cbl
- Select: Show Dependencies…
|
|
83
|
- Let's assume you want to view that copybook in one screen, and your main
program source in another.
- To split your editing view:
- Hold down the left-mouse button over the file tab. Drag to the left until your cursor
turns into a west-facing cursor ç Drop (release the mouse button)
- Note that you can:
- Maximize your editor view (Double-click the tab)
- Resize each of the vertical panes (Left-click, Drag & Drop)
|
|
84
|
- Note that you can:
- Maximize your editor view
- Resize each of the horizontal panes
- Left-click & Drag to size
|
|
85
|
- To split your screen while editing a single program: From inside the
source, press Ctrl+2
|
|
86
|
- You bet!
- Simply combine the Drag & Drop techniques discussed on the previous
slides
- & (op-ed) Consider the
benefits of this level of display and edit flexibility
- Especially for:
- Large programs
- Programs with many Copybooks & Includes
- Applications you are learning to maintain or support
|
|
87
|
|
|
88
|
|
|
89
|
|
|
90
|
- Reconcile record layout and picture clause mismatches
|
|
91
|
|
|
92
|
- Open StartApp.cbl and PrintApp.cbl in the Editor Area Select one of the program's tabs.
Hold-down the left-mouse button and drag to the right to create a Split
View
- Double-click to maximize
- Note the
- utility of seeing
- programs that
- call one another,
- passing parms
- etc.
- Close All
- Edit Areas
|
|
93
|
- Load cntrlbrk.cbl into the Editor Area.
Press Ctrl+2 to split screen.
The open the cobtable.cpy copybook into the editor. This will create three frames. Left-click-hold and drag the
cobtable.cpy down so that it becomes a horizontal split view. Consider how useful it would be to be
able to analyze programs like this.
|
|
94
|
- It's often necessary to compare two different releases of the same
program source.
- RDz makes this VERY easy to do – from the z/OS Projects explorer:
- Select the different .CBL files – note that they could be in the same
or in a different project
- Right-click – select:
- Compare With >
- Each Other
|
|
95
|
- Results are displayed in side-by-side windows (Maximized for best
viewing). Notes:
- Lines changed and new lines from either source file shown in different
shades
- Can click on the right-hand column border to navigate – and/or use the
toolbar č
|
|
96
|
- Can use Compare With/Each Other - with any ASCII file – even ASCII data
files
|
|
97
|
- This workshop will demonstrate the file compare functionality.
- Open StartApp.cbl into the Editor Area
- Press: Ctrl+A - to select all lines
- Press: Ctrl+Insert (or use the
Context Menu) - to copy all lines
- Right-click over your project's
\cobol\ folder, and select:
New > File
- Name the file: StartAppNew.cbl
- Paste: Ctrl+V - all of the copied source lines in
your new program
- Make a few changes to the source:
- Delete line(s)
- Add line(s)
- Modify line(s)
- Save your changes
- From z/OS Projects:
- Select both programs
- Right-click and select:
- Compare With > Each Other
- Experiment with:
- The toolbar icons
- The scrolling options
- Close all files
|
|
98
|
- Multiple ways to search for
text throughout source in your Workspace. We will cover them over
the next few slides.
- Ş Standard find:
- From anywhere inside your source, press:
- Ctrl+F …or… Ctrl+f
- Brings up the following dialog with find options č
- 1. Enter Find and/or Replace value
- 2. Check one or more search refinement options č
- 3. Press a Find button
- (covered on the next slide)
|
|
99
|
- Find option buttons:
- Next
- Find forward in the source
- Does not find text inside copy or include files
- Ctrl+n – finds next
- Previous
- Find upwards (back) in the source from your current cursor position
- All
- Finds all lines within the source
- Acts to exclude or filter source
- Press Ctrl+W to "show all" excluded lines …and/or to close
the find dialog box
- Clicking anywhere in the main body of your source file also closes
the Find dialog
- Click the pluses in the left-hand border as well – show filtered
source
- Replace
- Adheres to COBOL columns
- If replace would push text past column 73 you will receive a
warning)
- Replace all
- Changes "found" to replacement values throughout file
|
|
100
|
- Common ISPF editing technique
- Exclude various source lines
- Find (within) excluded lines
- Used extensively on giant production program source files
- Command ====> F (or C)
'xxx' X
- To perform this using LPEX:
- Do a Ctrl/F Search
- Then another search
- Subsequent searches will only look within the found (displayed) source
lines until you:
- Press Ctrl/W
- Or press the All button, which searches all source lines
|
|
101
|
- Another common ISPF technique
- Exclude various source lines
- Find within (not) excluded lines
- Command ====> F (or C)
'xxx' X
- To perform this using LPEX:
- Select (something)
- Exclude the selection
- Search (Ctrl/F) – and the search will (again) run against the displayed
lines
|
|
102
|
- Load test1.cbl into the editor
- Do a Find All: 01
- Note that it found a bunch of
comment lines Why?
- Restrict the column search to between 8 and 72
- Find All: 01 (again)
- Expand some of the plus-signs and un-filter the code
- Press: Ctrl+W … What does that do?
- Experiment with most of the Find/Replace options and option buttons
covered on the last two slides – but make sure to try out at least these
options:
- Case sensitive
- Whole word
- Replace
- Next
- Please do not
- save your changes
|
|
103
|
- Much of what you can do with Ctrl+F and the Find/Replace options can
also be done from the command line
- To find and replace text within a program:
- Press the Esc key – to
jump to the command line
- Enter:
- Press 8 Enter
- There are a number of useful
options from the command line for finding and replacing text
- Notes:
- If you are a "keyboard-oriented" developer, you may want to
try LPEX commands such as findText
- There are many other LPEX Editor Commands (see next slide)
- findText – the command, is case sensitive
|
|
104
|
- The LPEX command line (press escape key to access in one keystroke) can
be used to enter LPEX commands and actions.
- Some useful LPEX line commands are:
- help (or ?) – which brings up LPEX help
- help lpex – hot-keys, LPEX commands, actions
- help ispf – hot-keys, ispf prefix commands, actions
- submit (to submit JCL from the editor)
- arrow keys can be used in the command line to recall commands
- /text Finds the next occurrence of the specified text.
- Precede with minus sign to search backward -/text
- 'text (apostrophe text – ex.
'Temp-name ) - Finds the next occurrence of the specified text
- <lineNumber> - Locates the specified line
- get – copies an external file into the current cursor-focus point
- print – prints the file
- top – jump to the top of file
- bottom – jump to the bottom of the file
- ! TIP - all LPEX Command
Line commands are case sensitive
|
|
105
|
- Load test1.cbl into the editor
- Type in, and execute the following LPEX search and command line options (don't
forget that you can use the up arrow key to return the previous LPEX
command):
- bottom
- top
- findText perform
- findText all perform
- findText all 01
- findText all columns 8 12 01
- help ispf
- help lpex
- 10
- /program
- get printapp.cbl
- Do NOT save changes!
|
|
106
|
- (From the Search menu)
- RDz has powerful search facilities for finding text:
- In Local z/OS Projects
- In Remote z/OS Projects (on the mainframe)
- Filtered by:
- Text
- Wildcard text
- Filename wildcard text
- Search can be scoped to:
- Your entire Workspace
- A subset of your Workspace (Selected resources)
- You can open and go to the source by clicking the "found"
text
|
|
107
|
- This is a very fast and efficient way to search for text:
- In a file
- In your project
- Throughout your workspace (multiple projects)
- Steps:
- Set your cursor focus inside the word you wish to search on
- Open the Search menu and select:
- Text >
- From the matches view č
Double-click the found results to select specific text
|
|
108
|
- Often you will want to selectively replace found text. There are number of ways to do this,
but you might try the following as a "best practice"
- Start from the File or Project search – to create a list of statements
or lines that are replace candidates
- From the Search view, use Ctrl/Left-click to select specific instances
to be Replace
- Right-click and choose: Replace Selected…
- Specify the Replacement value and Preview > or click OK
|
|
109
|
- Exercise #1 – File Search:
- Open the Search menu
- From the Remote Search tab – enter Search string: WS-*-SW
- File name patterns: *.cbl
- Folder:
- Use the Browse… button to locate your chapter1 project
- Check: Search subfolders
- When the results come back,
- Expand the lines in the Remote Search tab on the bottom
of the Workspace – and click the
- Note – you will need cntrlbrk.cbl in your project for this exercise
- Exercise #2 – Text Search:
- Edit cntrlbrk.cbl
- Double-click (to select) any piece of text on the program. Then from the Search menu select:
- Examples:
- an FD: MI-INPUT-FILE
- A variable: PAID-DATE-IN-NUM
- A paragraph name: 210-PRSS-INPUT-RECORDS
- A COBOL keyword: READ
|
|
110
|
- Large complex programs can be more easily understood, viewed
modified and maintained if
certain details are filtered out
- From the Context Menu
- click Filter view >
- and select
- Divisions – collapse and expand filters by COBOL Divisions
- Code – filters out comments
- Comments – filters out code
- Outline – shows high-level abstraction of your source (very useful)
- Embedded SQL/CICS/DLI – show only SQL statements, or EXEC CICS
- Errors – show only syntax errors
- To show all of the lines of source in your editor:
- Press Ctrl+W – or use the Context Menu's "Show All" option
|
|
111
|
- Filter all statements except for
- Note the plus signs č
Expand/Collapse filtered code
- Press Ctrl/W to un-filter and return to normal program view
|
|
112
|
- Double-click to select a:
- COBOL Keyword
- Literal
- Variable
- Label (Paragraph or Section name)
- Right-Click
- Note the plus signs Expand/Collapse filtered code
- Press Ctrl/W to un-filter and return to normal program view
|
|
113
|
- Exercise #1 – Context Menu filtering
- 1. Copy the COBOL program below into a new file named: CADDDB2.cbl
- … inside your \cobol\ folder in your chapter1 project
- Ensure that the IDENTIFICATION DIVISION line is in the A margin
- Save the file
- 2. Try each of the filters out on this and the next slide – even
Comments and Code
- Be sure to expand the filtered source lines by clicking the plus signs
in the Editor's left-hand border
- Exercise #2 – Filtering selected text
- Open test1.cbl in the editor
- Use the technique of: a. selecting some text, b. Using Selected >
Filter selection to isolate and display:
- Statements:
- Variables:
- Literals (with single quotes):
- Paragraphs:
|
|
114
|
- RDz views that allow you to understand a program from a higher level of
abstraction
- č Open Perform Hierarchy
displays a view of your PROCEDURE DIVISION paragraph chaining, through
SECTION or paragraph PERFORM statements
- You can:
- Start anywhere in the Procedure Division – and drill up or down
- Navigate:
- From the code:
- Select different paragraphs or PERFORM statements the Hierarchy View
changes
- From the Perform Hierarchy View:
- Select a paragraph or SECTION label in the Perform Hierarchy and
navigate to that line in the program source
|
|
115
|
- Exercises:
- 1. With test1.cbl open in the editor:
- Find, and set your cursor-focus (note that you do NOT have to
double-click) in 200-PROCESS-RECORDS
- Right-click and select: Open Perform Hierarchy
- Navigate using the Perform Hierarchy
- 2. With cntrlbrk.cbl open in the editor:
- Find, and set your cursor-focus in 300-SRT-OUTPUT-PROCD
- Right-click and select: Open Perform Hierarchy
- Navigate using the Perform Hierarchy
- 3. With CADDDB2.cbl open in the editor:
- Find, and set your cursor-focus in 0500-EDIT-SCREEN
- Right-click and select: Open Perform Hierarchy
- Navigate using the Perform Hierarchy
|
|
116
|
- Renaming variables and paragraph or SECTION labels can have far-reaching
and sometimes unintentional consequences L
- Refactor allows you to Preview the impact of a change
before deciding to go through with it J
- To Refactor/Rename:
- Select the variable or Paragraph name you wish to change
- Right Click, and from the Context Menu select Refactor > Rename
- Overtype the old name with the new name
- Click Preview >
- 5. Preview automatically scopes the change. Click Continue
|
|
117
|
- 6. Finally, the Refactor wizard displays the deltas between your
original and Refactored source side-by-side, allowing you to verify
before proceeding.
- 8 Click OK to rename
- (if you press Cancel no changes are made to your source)
|
|
118
|
- Steps:
- 1. Create a new COBOL program in the \cobol\ folder of your chapter1
project (using either of the techniques shown earlier in this course) –
name it testRefactor.cbl
- 2a. Edit test1.cbl
- 2b. Press Ctrl+A
- 2c. Press Ctrl+Ins (insert key –
this copies all of the source statements)
- 2d. Paste the copied source into testRefactor.cbl
- 3. In testRefactor.cbl Refactor:
CTR-LINES - change it to WS-CTR-LINES
- 4. Refactor: 200-PROCESS-RECORDS
- - change it to: 201-PROCESS-RECORDS
- After you've finished, Syntax Check testRefactor – to make sure
everything worked as expected
|
|
119
|
- Periodically during development, you will want to save and syntax check
your code
- To Save:
- From the Context Menu select Save
- Or, with edit-focus in your program source, press: Ctrl+S
- Or click the disk file icon -
in the top left-hand corner of the Workbench
- To Syntax Check
- From the Context Menu select:
- Save and Syntax Check (if your file has outstanding changes that have
not been saved yet)
- Local Syntax Check – if all the changes have been saved (and there is
no asterisk next to the file's name in the editor tab)
- Remote Syntax Check – which runs a compile-only syntax check on z/OS
(i.e. this does not create binaries (Load Modules) – so it is
relatively inexpensive and fast)
- Note that Remote Syntax Check is only available for MVS Sub-Projects
not Local z/OS Projects. We'll
learn how to use these later in the course
- 1If there are no syntax
errors, Local Syntax Check will populate the BuildOutput folder with
temporary object code and listing files.
|
|
120
|
- Even with Content Assist and copy/paste between multi-screen views you
will sometimes end up with syntax errors
- To correct syntax errors in your source:
- From the Remote Error List View
- Look at each syntax error …or…Mouse-over the error to see an
explanation in "hover-help"
…or…
- Double-Click the error – to bring up the line in question in the
editor
- 3. Use Content Assist to fix
the error
|
|
121
|
- Steps:
- Open PrintApp.cbl in the editor
- Scroll to the bottom of the file
- Make these three mistakes - change:
- Char-Count ŕ Char-cout
- Inspect ŕ Inspet
- Tallying ŕ Tallig
- Right-click and from the Context Menu select: Save and Syntax Check
- From the Remote Error List – for each error (red-x):
- Double-click the line (to position your cursor)
- Backspace and use Content Assist (Ctrl+Spacebar) to select and fix the
error
- With all errors fixed,
- Right-click and from the Context Menu select: Save and Syntax Check
|
|
122
|
- Fear not! Select the COBOL word
you're unfamiliar with, and press:
F1
- Help
|
|
123
|
- Content Assist (Ctrl+Spacebar) can also help you build new COBOL
statements:
- : Workshop:
- With test1.cbl open in the editor
- Enter a few new blank lines
- Enter the beginnings of some COBOL statements:
- Experiment with the Ctrl+Spacebar statement models
- Please do not save changes
- Note that you can combine model statement building, with
content assist to select declared COBOL variables
from the DATA DIVISION into
the statements.
|
|
124
|
- When you have selected a line or some text in a line, there are two useful
options under Context Menu:
- Source >
- Comment selected lines
- Comments out – with an asterisk in column 7
…one or more lines of COBOL source
- Uncomment selected lines
- Will uncomment all selected lines
- View current line in Hexadecimal
- Note that the "selected byte" shows in gray
- Click in the main body of the source, to close hex view
|
|
125
|
- So – what more do you have to learn about, in order to edit COBOL program source?
- We've already covered a good bit of ground.
- However, it's time to learn how to:
- Select lines and/or blocks of code
- Copy/Cut/Paste selected lines
- Shift selected text right or left
- Make the selected text upper or lower case
- Note:
- All of these text editing techniques have Hot Key combinations – for
"power typing"
- Most are standard, Windows text editing operations you may have used on
your PC with MS-Word, MS-Notepad, etc.
- ERGO - We will not describe much about these techniques – assuming you
already understand what they do
- But instead, we will just show examples using COBOL code
|
|
126
|
- 1. Select something:
- Drag with your mouse
- Left-to-Right/Top-to-Bottom
- Or select a:
- Single line – Alt+L
- Rectangle: Alt+R (see next slide
for details)
- Character – Alt+B
- 2a. Copy selected code – Ctrl+C
- 2b. Cut selected code – Ctrl+X
- To copy, move or to delete
- 3. If copy or move, paste the selected
code – Ctrl+V
- Notes:
- Be aware of language (COBOL) source margins
- Cursor insert-point is where text will flow Left-to-Right/Top-to-Bottom
from
- Can clear selection (de-select) with Alt+U
|
|
127
|
- Rectangle selection provides some
convenient operations:
- Set cursor to 1st character of rectangle:
- Top left – or bottom right corner
- 2. Press Alt+R – or use Context Menu to enter Rectangle copy/paste
edit mode
- 3. Left-click, hold and drag the cursor to the opposite corner and
select a text block
- 4. Use Alt keys or Context menu to manipulate text
- …or Alt/F8 shifts right one character č
|
|
128
|
- 1. Select a block of text and use the
Context Menu …or…
- 2a. Press Alt+K to make all letters in the block upper-case
- 2b. Press Alt+I to make all letters in the block lower-case č
- 2c. Press to Ctrl+/
to comment out, a block of code č
- 2d. Press Ctrl+\
to un-comment the block č
|
|
129
|
- A common requirement/technique is to fill in a portion of a repeated
line. Example – need to copy same
or similar PIC clauses to multiple records:
- Set cursor to beginning character of copy text
- 2. Press Shift+End – to select rest of line
- 3. Press Ctrl+C – copy selected portion of line
- 4. Position cursor at beginning of paste/area č
- 5. Press
Ctrl+V – to paste copied text.
- 6. Repeat steps 4 & 5
|
|
130
|
- 1. Hex Edit
- Open StartApp.cbl in the Edit Area
- Add a value clause to Input-name's PIC
- Place your cursor over the variable line
- From the Context Menu select:
- 2. Select/Copy/Cut/Paste text
- Open PrintApp.cbl in the editor
- Select some code and use any/all of the editing techniques in the
Context Menu – but definitely try at least the following common source
modification operations:
- Alt+L – to select a line
- Ctrl+C
- Ctrl+V
- Ctrl+X
- Alt+U – to de-select
- 3. Working with Code Blocks
- Open StartApp.cbl in the Edit Area. Using your mouse, drag and select a
block of source lines
- Open the Context Menu and try the Selected menu options:
- From the Context Menu use the Source option to:
- Comment the selected lines
- Uncomment the selected lines
- From the Context menu – Deselect the selected block of lines
|
|
131
|
- Reusing code has been a "holy grail" of software development
for decades. While there is no
silver bullet solution, there are a number of innovative and useful
options in RDz for this:
- Program Templates
- Code Snippets
- We've already seen in previous slides that you can create new programs
using templates, which allows you to create and enforce standards, and
simplify development.
- Snippets allow you to create smaller, "packets" of reusable
code – from single statements to routines.
- We'll first look at customizing the program templates:
- To access their defaults:
- From Window > Preferences > COBOL > Code Templates
|
|
132
|
- You can create a custom Code Template for COBOL comments or the base
program code itself.
- To add or customize comments:
- Click the comment option you wish to modify
- Code an asterisk in position 7 (you'll have to space over 1-6)
- You can insert Variables that are filled in when new
"templatized" programs are created
|
|
133
|
- And you can add your own entries, common files, databases, variables,
routines etc. to either:
- An entire program
- Separate program divisions
- When a new program is created using the templates all of the custom
comments and code are inserted.
|
|
134
|
- Sometimes, instead of entire programs you might want to:
- Save some code temporarily for reuse
- Create a paragraph, computation, complex conditional – that can be
re-purposed in other programs
- Provide a library "standard" routines – using your shop's
coding conventions
- Provide a library of syntactically-correct and infrequently
used/high-value statements:
- Database routines
- Complex COBOL code: UNSTRING etc.
- Snippets are the preferred way of doing this. You access them through a Snippets
view, which you get to by:
- From Window > Show View > other…
- Type: snippets – and select the Snippets view
- On the right are a group of custom Snippets that we have created. You will see a subset of these.
- Individual Snippets are contained in "drawers" which are the
accordion menus that collapse/expand
on-click.
- Snippets can be Exported and Imported (for sharing among team members)
|
|
135
|
- To use an existing code Snippet follow the steps below:
|
|
136
|
- To create a new code Snippet follow the steps below:
|
|
137
|
|
|
138
|
- If you are using RDz v7.6 or later, a number of very useful IMS Code Snippets are shipped
with the product č
- These snippets go beyond simple text-based insertion to
read your Data
Division entries, and offer options for building statements
using combo-boxes
|
|
139
|
- : Open the Window menu, and
select Preferences
- From Preferences:
- Select LPEX Editor
- Select your Editor profile
- Click: OK
- $ Note: We will cover both
editors in this section – starting with the ISPF editor. If you're not
interested in learning the ISPF editor, skip ahead to the slide titled: Introduction
to the LPEX Editor
|
|
140
|
- Standard-issue ISPF Prefix Area, Command Line, and source editing options
|
|
141
|
- 80/20 ISPF edit commands supported with same functionality as on the
mainframe
- For a complete list of supported prefix commands:
- Place your cursor in the prefix area
- Press F1
|
|
142
|
- 80/20 ISPF edit commands supported with same
functionality
- F – Find (first, last, all,
etc.)
- C – Change
- RES – reset (clear edit view)
- Num on/off
- UNNUM
- X - exclude
- Other – check the product help
- Combined commands as well
- Example: x all ; f all '<literal>'
|
|
143
|
- Note: To show n excluded lines within an excluded block:
- Position your cursor on the excluded marker
- Type:
- F n … or L n - in the prefix area
- Where n is a number of lines to show
- F – shows the first n lines
- L – shows the last n excluded lines
|
|
144
|
- Two different ways to split and join lines:
- 1. Split/Join lines:
- Position Cursor
- Press Alt/S
- Join lines
- Position Cursor
- Press Alt/J
- 2. Split/Join lines:
- Position Cursor
- Ctrl+Enter
|
|
145
|
- PF1 – Help
- PF5 – Repeat Find
- PF6 – Repeat Change
- PF7 – Page Up
- PF8 – Page Down
- See tables on next slides for complete side-by-side comparison
- Can combine ISPF functionality with:
|
|
146
|
- Open the file: testRefactor.cbl – and using the information on the
previous slide, try the following ISPF editing techniques out
- If you haven't already done so, from: Window > Preferences > Lpex Editor, select ispf as your edit profile
|
|
147
|
- : Open the Windows menu and
select Preferences
- Expand:
- Click: User Key Actions
- (from the bottom part of the tab) Enter the following:
- Key: f2
- From Action, select: deleteNextWord
- Click Set
- Click OK
- Try this new PF-key function out on testRefactor.cbl
|
|
148
|
- 7 ISPF benefits:
- Reuse of your ISPF skills
- Well-adapted to COBOL line-oriented code style
- Excellent for "pure development"
- Keyboard-engaged work
- Useful column-prefix commands
- Recommended default for experienced developers who started with ISPF
- 8 LPEX benefits:
- More code view/real estate
- <Enter> key opens a new line
- Copy/paste
- Persistent
- Partial text
- Statements
- Variables and paragraphs
- Fragments
- Code blocks (no need to create temp PDS members)
- Recommended default for developers who started with Windows text
editors
- ¤ Recommendation: Try both,
giving each a fair bake-off
|
|
149
|
- Eclipse and the Workbench tools:
- How do you open files for editing … and switch from one open file to
another?
- What is the “Editor Area”? What
is z/OS Explorer?
- Is there a way to close all files that are open in the Editor Area?
- How do you maximize the Editor Area?
And resize it back to see the Eclipse tools?
- What two keys (when pressed simultaneously) give you Content Assist for
editing?
- What does Content Assist do?
- What are the two methods of creating a new COBOL program?
- Where is the option for running or debugging a local (Workstation)
COBOL program?
- How do you open a second copy of your program for edit in another
window?
- How do you open a view if you inadvertently (or “advertently”) close
it?
- What is the Outline View – and where is it located?
- What is the Perform Hierarchy view – and how do you access it?
- What is the Context Menu – and what key combination do you press to
bring it up?
- How do you syntax check a program?
- Speaking of syntax, what does that little yellow triangle mean when it
appears in the border of your source file during a COBOL editing
session?
- What editing option allows you to (in one keystroke) – find the
declaration of a variable or paragraph in your COBOL source?
- What view shows you the characteristics or attributes of a selected
COBOL program?
- Why are some of the Context Menu options grayed out at certain times?
- What Context Menu option allows you to isolate (within your source
file) all of the: Comments, Code
(no comments), Errors, SQL statements, an outline of the Divisions and
01 variables, etc.?
- What Context Menu option allows you to isolate a single keyword,
variable or text selection throughout your source code?
|
|
150
|
- In this topic you have seen a number of editing techniques:
- Native LPEX
- ISPF Emulation
- Hopefully you've done some workshops throughout, but if not, at this
point in time it would be helpful to return to follow the directions on
the "do it" slides
- If you've followed, and have changed your editor to ISPF, you can:
- Leave it as ISPF for next unit
- Switch back to LPEX mode, from:
- Be sure to close RDz
|
|
151
|
|
|
152
|
- After completing this topic, you should be able to:
- Describe the configuration model for running and/or debugging local
COBOL applications
- Create a Launch Configuration – for running and/or debugging local
COBOL application
- Define COBOL ENVIRONMENT DIVISION entries compatible with Windows PC
COBOL work
- Run local COBOL applications – that respond to ACCEPT/DISPLAY UI
- Debug local COBOL applications and use the majority of the RDz COBOL
source debugging features successfully
|
|
153
|
- You can run and/or debug your COBOL applications as standalone Windows
executables.
- To do this, you will need the following:
- Clean compile of your entire project (Note – not just the COBOL program
you wish to run or debug, there can be no syntax errors above
warning-level in the project)
- A Launch Configuration – which defines parameters, and other settings
needed to debug or run your application as an executable, on Windows
- Your source available
- Your input files and output files specified in PC-COBOL SELECT/ASSIGN
syntax
|
|
154
|
- & "Perspectives"
- Recall that a "Perspective" is a convenient grouping for a
collection of views organized around a given role or task
- So far in this unit you've used the z/OS Projects Perspective – to
learn:
- About RDz
- Understand the use of Projects, Views and other eclipse facilities
- How the editor works – features,
typical development workflow, etc.
- In this section we will introduce you to the Debug Perspective – which allows you
to do source-code (line-by-line) testing of your COBOL logic
- We will start by showing you how to debug local (Workstation-based)
COBOL programs
- In subsequent units we'll learn how to debug mainframe applications (batch
and online)
- Both local and mainframe debug facilities are almost 100% identical
- Learning how to do local debugging will set you up for learning the
mainframe debugging features
|
|
155
|
- You will need the following:
- A project – that compiles clean
- One or more COBOL programs to debug
- A Debug Configuration
- Let's start by creating a new project.
- But – in order to save time and focus on debugging per se' – we'll use
one of the example projects that
ships with RDz
|
|
156
|
- Open the File menu and select:
- New > Example…
|
|
157
|
|
|
158
|
|
|
159
|
|
|
160
|
|
|
161
|
|
|
162
|
|
|
163
|
|
|
164
|
|
|
165
|
|
|
166
|
|
|
167
|
|
|
168
|
|
|
169
|
|
|
170
|
|
|
171
|
|
|
172
|
|
|
173
|
|
|
174
|
|
|
175
|
|
|
176
|
|
|
177
|
- From the File menu, select:
- Expand Workstation COBOL
- Select COBOL Sample 1
- Click Next >
- Name the project: DebugLab
- Click Finish
|
|
178
|
- From z/OS Projects
- Right-click over the project and select: Rebuild Project
- Expand BuildOutput
- Right-click over StartApp.exe,
and select:
- Debug As >
- Debug Configurations
- From Debug Configurations
- Select Compiled Application
- Click the New launch configuration icon
- Name the Debug Configuration
- Instructions continue on the next slide…
|
|
179
|
- In the Program name: area:
- Click Browse…
- Use the Windows dialog to find and select the directory for your
Workspace\Project\ BuildOutput folder and StartApp.exe file
- Note that the icon might not show the file suffix – select the run
icon as shown
- Click Open
- From the Debug Configuration window click:
- Click "Yes" at the Confirm Perspective Switch prompt
|
|
180
|
- Apply the Debugging techniques you learned in this
section:
- Breakpoints:
- Entry to PRINTAPP č
- On specific lines
- Remove breakpoints (you've added)
- Step into the code
- Use the various step options
- Run to your breakpoints
- If you run past the breakpoints and would like to start again, use the
toolbar to restart your Debug session:
- If you'd like to just stop, hit the Terminate sign, on the toolbar:
|
|
181
|
- From the Variables and Monitors tabs:
- Modify values on the fly
- Monitor variables
- Detach the Monitored variable list
|
|
182
|
- Other techniques:
- Mouse-over hover value
- Jump to/Run to Location
- Add Tasks and Bookmarks
- Use the Context Menu
- Terminate and remove all terminated debug sessions when done
- Return to the z/OS Perspective
|
|
183
|
- In order to pull together all of the edit, compile and debug techniques
described in this section, if time permits at work:
- Please go to the Enterprise Modernization Sandbox
- http://www.ibm.com/developerworks/downloads/emsandbox/systemz_applications.html
- Select and print out the following PDS
- http://download.boulder.ibm.com/ibmdl/pub/software/dw/rational/emz/Local_IBM_zOS_application_development.pdf
- Follow the Sandbox Slides to:
- Register
- Download and install the Citrix client (first-time
only)
- Use the Sandbox
- And follow the detailed Instructions in the IBM Proof of
Technology labč
|
|
184
|
- After having completed this topic, you should now be able to:
- Describe the configuration model for running and/or debugging local
COBOL applications
- Create a Launch Configuration – for running and/or debugging local
COBOL application
- Define COBOL ENVIRONMENT DIVISION entries compatible with Windows PC
COBOL work
- Run local COBOL applications – that respond to ACCEPT/DISPLAY UI
- Debug local COBOL applications and use the majority of the RDz COBOL
source debugging features successfully
|
|
185
|
|
|
186
|
|
|
187
|
- The Education Assistant has a number of
detailed and useful Camtasias that show use cases for both RDz
(standalone) and RDz integrated with other tools (such as Rational Team
Concert)
|
|
188
|
- IBM's RDz and COBOL Cafés contain white papers, links to additional
learning resources and Q&A forums.
The forums are reviewed by the RDz development team – who send
out responses first-hand to technical questions.
|
|
189
|
|
|
190
|
- From the File menu, select:
- Expand Workstation COBOL
- Select COBOL Sample 1
- Click Next >
- Name the project: chapter1
- Click Finish
|
|
191
|
- From z/OS Projects
- Double-click StartApp.cbl
- This will load the program source into the COBOL editor
- Scroll around in the source file – and have your first look at a COBOL
program (not so scary… )
- Don't change any of the source (yet)
- But you can size the editor window to see more source
- $ Note that in the next
course unit ("RDz Workbench") – we will cover the tools and
development facilities you're looking at.
|
|
192
|
- From z/OS Projects
- Expand BuildOutput
- Right-click over StartApp.exe,
and select:
- Run As >
- Run Configurations
- Note that if you do not see a BuildOutput folder:
- Right-click over the chapter1 project
- From the context menu select: Rebuild Project
- From Run Configurations
- Select Compiled Application
- Click the New launch configuration icon
- Instructions continue on the next slide…
|
|
193
|
- In the Project area, type: chapter1
- In the Program name: area:
- Click Browse…
- Use the Windows dialog to find and select the directory for your
Workspace\Project\ BuildOutput folder and StartApp.exe file
- Note that the icon might not show the file suffix – select the run
icon as shown
- Click Open
- From the Run Configuration window click:
|
|
194
|
- This will launch a DOS application that prompts you for either a name,
or a Q (upper or lower-case) to quit
- Enter a few names – after each name, press the 8Enter key
- Enter: Q to quit
- $ Optional:
- Browse through the StartApp and PrintApp
program source. If you're
an
experienced COBOL
programmer taking this course to learn RDz, note
the differences
between these
two programs and the
COBOL datasets you typically work with
|
|
195
|
|
|
196
|
|
|
197
|
|
|
198
|
|
|
199
|
|
|
200
|
|
|
201
|
|
|
202
|
|
|
203
|
- To become more innovative and more competitive, companies know that education – in all forms is necessary
- today more than ever.
- To help, IBM has implemented solutions that feature community-based
knowledge sharing - that give your developers instant, secure access to
shared content, and expertise in:
- COBOL / IMS / CICS / DB2 and z/OS Technologies
- Rational Developer for System z (RDz)
- Rational Asset Analyzer (RAA)
- Check out the COBOL Café
- http://www-949.ibm.com/software/rational/cafe/community/cobol
- And check out upcoming free, self-paced IBM training in:
- RDz / RAA / COBOL / IMS / CICS / DB2
|