C DOCUME 1 Sscott - Cts LOCALS 1 Temp Plugtmp Plugin-RDi StudentExerciseGuide
C DOCUME 1 Sscott - Cts LOCALS 1 Temp Plugtmp Plugin-RDi StudentExerciseGuide
cover
System i Application
Development Using
WebSphere Development
Studio Client, Version 7.0
Student Exercises
ERC 2.0
Trademarks
IBM® is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
System i i5/OS Integrated Language
Environment
iSeries Language Environment WebSphere
OS/400 Rational
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Microsoft, Windows, Windows NT, Windows XP, and the Windows logo are trademarks of
Microsoft Corporation in the United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Linux is a trademark of Linus Torvalds in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.
The information contained in this document has not been submitted to any formal IBM test and is distributed on an “as is” basis without
any warranty either express or implied. The use of this information or the implementation of any of these techniques is a customer
responsibility and depends on the customer’s ability to evaluate and integrate them into the customer’s operational environment. While
each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will
result elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.
© Copyright International Business Machines Corporation 2005, 2008. All rights reserved.
This document may not be reproduced in whole or in part without the prior written permission of IBM.
Note to U.S. Government Users — Documentation related to restricted rights — Use, duplication or disclosure is subject to restrictions
set forth in GSA ADP Schedule Contract with IBM Corp.
V4.1
Student Exercises
TOC Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
iv System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
TMK Trademarks
The reader should recognize that the following terms, which appear in the content of this
training document, are official trademarks of IBM or other companies:
IBM® is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
System i® i5/OS™ Integrated Language
Environment®
iSeries™ Language Environment® WebSphere®
OS/400® Rational®
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft
Corporation in the United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Linux is a trademark of Linus Torvalds in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.
vi System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
viii System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
x System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Important
WebSphere Development Studio Client 7.0 still refers to “iSeries” on product panels and
menus instead of “i5/OS”. The convention used in this course is that we will use “iSeries”
when needing to refer to product panel or menu text, but will use “i5/OS” in other instruction
text to accurately reflect the current system name. We are using “i5/OS” instead of “System
i” to be more accurate in the situation where System i has multiple partitions (i.e. i5/OS,
Linux, AIX).
In any case, “iSeries” and “i5/OS” should be considered interchangeable and equivalent,
and use of both terms in these exercises is intentional.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
- Open a member for edit from the iSeries Table view or the
Remote Systems view
- Maximize the editor window
- Open another member for edit
- Switch from one edit session to another edit session
- Display a structural outline of items defined in a source member
• Describe the features of Remote System Explorer
- Create a filter to show specific i5/OS libraries
- Change the filter to add more i5/OS libraries
- Create a filter to show all the source files in a library
- Access members to edit from your filter
- Create a user action that copies a source file with data to a new
source file in the same library
- Specify user action parameters
- Specify a restriction on a user action
- Test the user action
- Run an i5/OS command from the iSeries Table view
Introduction
In this lab, you will learn how to create a connection to an i5/OS
system, find a library in your library list, select objects from a library,
and open a member in the Remote Systems LPEX Editor. You also
learn about several views such as the Remote Systems view, iSeries
Table view, and the Outline view.
You also customize the Remote System Explorer perspective to work
with i5/OS objects by defining filters, performing actions, and defining
your own actions. In short, you'll see how Remote System Explorer
can organize and integrate your work and make that work easier.
1-2 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Hint
Throughout the exercises, you will need to refer to your lab information sheet for userids or
i5/OS names, etc. The convention we use is to indicate a substitution variable in the
exercise text/screenshots enclosed in bracket characters ‘<‘ and ‘>. For example, you may
see <i5/OS_system> listed in a prompt within a WDSC panel screenshot. Find this
variable on the left-hand column of your lab information sheet, and get the appropriate
value from the right-hand column to enter into the product panels/prompts to completely
replace <i5/OS_system>. Do not enter the actual ‘<‘ and ‘>’ characters - those are just to
indicate a substitution variable lookup to the lab information sheet.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Hint
If you are working with the Advanced Edition of the product you will see the words
“Advanced Edition” in the product name.
__ 4. A Workspace Launcher dialog will appear. Here, in the next step, you will specify the
directory of the workspace where your projects and other resources such as folders,
subfolders and files that you are developing in the workbench will reside.
__ 5. Replace the final subdirectory name in the default workspace name in this
Workspace Launcher dialog and use the directory name from your lab worksheet,
<i5/OS_userid>. For example, rselabxx (where xx is your team number, such as
rselab01).
Make sure the Use this as the default and do not ask again checkbox is not
selected.
1-4 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 6. Click OK to open the workbench. You should see a Welcome tab with circular
hotspot links to information topics. If you do not see this Welcome tab, from the
menu bar, Help -> Welcome will display this tab.
If you move the mouse over the circular icons on this Welcome panel, you will see
circular hotspot links to the following topics:
• Overview of features
• What’s New
• Samples
• First Steps
• Tutorials
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
• Web Resources
• Migrate to new release information
At the bottom of the window are icons displaying currently active user roles, and a
large icon to select or de-select user roles. Specifying user roles allows you to see
just the functions you need to perform your job, simplying the user interface within
WDSC that you need to deal with.
__ 7. Click the icon in the far right of the Welcome page to go to the workbench.
You will notice that the hotspot links to samples, tutorials, etc are now minimized and
docked to the bottom right corner of your workbench. We will examine these further
later in this lab. From the menu bar, you can always use Help -> Welcome to show
this Welcome tab information again.
__ 8. Click the maximize button to maximize the workbench.
1-6 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty paradigm for the creation, management, and navigation of workbench resources.
Each workbench window contains one or more views and an editor.
A perspective defines the initial set and layout of views in the workbench window.
Within the window, each perspective shares the same set of editors. Each
perspective provides a set of capabilities aimed at accomplishing a specific type of
task or working with specific types of resources. For example, the Java perspective
combines views that you would commonly use while editing Java source files, while
the Debug perspective contains views that you would use while debugging a
program. Perspectives contain views and editors and control what appears in
certain menus and tool bars.
__ 2. If you see a different perspective (not the Remote System Explorer) in the
workbench or no perspective, click Window > Open Perspective > Remote
System Explorer from the workbench menu.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
This perspective will be active when you start the product with a new workspace. If
you had used the workspace before, the workbench would come up with the
perspective that you last opened. You will learn more about the Remote System
Explorer perspective in the coming exercises as this is where you launch the i5/OS
programmer tools and use the views from the workbench.
__ 3. Examine the iSeries RSE Getting Started tab in the middle pane of the workbench.
This iSeries Remote System Explorer Introduction is new for WDSC 7.0, and assists
developers currently using PDM and SEU to migrate to the WDSC RSE
Eclipse-based integrated development environment (IDE).
Subject areas include information and help links regarding:
• Creating connections
• Library lists
• Table views
• Opening and compiling members
• Running and debugging programs
• Filters
Close the iSeries RSE Getting Started tab by clicking on the ‘X’ in the tab title area.
You can view this introduction information again whenever you need it by going to
the WDSC menu bar and selecting Help -> iSeries RSE Getting Started.
1-8 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 2. We will not cover editing, copying, renaming, moving, or deleting local files, at this
time, however, we do want to mention the capability here. You have the ability to
copy or move files and directories from your local Windows PC to a remote system
that you define, and also copy or move files and directories from the remote system
to your local Windows PC.
__ 3. Click the minus sign (-) in front of Local to close this node.
__ 4. Click the plus sign (+) in front of New Connection to expand that node, if New
Connection is not already expanded.
__ 5. You will see connections for iSeries, Windows, Linux, Unix, and AIX systems. Once
defined, these are system types that you can copy/move files and directories to/from
your local Windows PC.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Click the plus sign (+) in front of iSeries to configure a connection to an i5/OS
system.
1-10 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. In the Host name field, type <i5/OS_system> (refer to your lab information sheet
for the system name to enter).
The Connection name is automatically filled with the host name specified. You can
leave it this way to work better with the values on your lab information sheet. This
name displays in your Remote Systems view and must be unique to the profile.
__ 4. Leave the Parent profile default value. You don't need to change it.
__ 5. The information in the Description field will appear in the Properties view for the
connection - you can leave this blank, or put in a description of your choice.
__ 6. Leave the Verify host name check box selected.
__ 7. Click Finish to define your system. Clicking Next would bring up a panel with
informational tips, and you would then click Finish from that panel.
Information
Since you specified to verify the host name, WDSC will ping the i5/OS host name you
specified, and the connection configuration will halt if the i5/OS can not be accessed. If you
know the i5/OS host name is correct and your PC is currently not connected to the network,
uncheck Verify host name, and the connection configuration will complete.
1-12 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-14 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty You also have more entries to work with under the connection itself and you can see
from these entries that Remote System Explorer goes well beyond PDM. It allows
you to explore i5/OS jobs and commands and the integrated file system.
__ 3. Work with a library in your library list and add the library that you'll be using in this
tutorial:
Right-click iSeries Objects and click Properties on the pop-up menu.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 5. Type the value of <team_lib> in the Library field and click Add.
__ 6. Click OK.
This will add the library to your library list every time you use this connection. The
library list specified on this panel is added to any library list that may be associated
with your user profile’s (*USRPRF) job description’s (*JOBD) initial library list.
The Current library by default will come from the *CURLIB setting in your user profile
(*USRPRF).
Since the WDSC connection is typically a prestart batch job and is not an interactive
job on i5/OS, the initial command associated with the user profile (*USRPRF) is not
run at connection time. To associate an initial command with the connection, that
must be done via the Initial command prompt on this Initial Library List panel.
1-16 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty
Note
Note: You can also change your library list using the pop-up menu items Add Library List
Entry or Change Current Library on the Library list folder in the iSeries Objects
subsystem. These changes are only valid until you disconnect.
Now the connection will be activated and you will be prompted for a user ID and
password.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-18 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Back in the workbench in the Remote Systems view you will see the libraries in your
job's library list.
Notice that the <i5/OS_system> folder now has a small green arrow in the icon to
indicate it is an active connection.
Let’s take a moment to examine the libraries in the library list. Any library with
prod-sys means it comes from the system portion of the library list, defined by
*SYSVAL QSYSLIBL.
prod-cur is the current library and is indicated by a green asterisk. In your case,
RSEWDSC was specified as *CURLIB in your user profile when the *USRPRF was
created.
RSEWDSC2 was specified in the job description (*JOBD) associated with your user
profile as your initial library list.
<team_lib> was the library you specified a few steps ago on the Initial Library List
panel. It is added to any library list associated with your user profile. You also
specified it to be *LAST in the library list, which is why it shows up last on this list.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
For each library, you can right-click and select from a number of actions. For
example, there is an action to create a new source physical file within the selected
library. Common actions like delete, move, and copy are valid for all kinds of objects.
You have connected to an i5/OS system.
Important
If you prefer to work with COBOL, go to and follow the instructions in “COBOL Track” on
page 1-21.
If you prefer to work with RPG, go to and follow the instructions in “RPG Track” on
page 1-52.
1-20 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Now you can see and access the members in these two source files. For each
member you can right-click and select from a number of actions. The exact list of
actions depends on whether the member is a data file or source file and whether you
select one or multiple members. For a COBOL source member, the pop-up menu
actions include:
• Open with
• Browse with
• Verify
• Compile
Before you work with these members, examine the iSeries Table view, which is similar to
the view in PDM. You use this view to display a list of items (for example, members or
objects) in a table format similar to PDM. You can also perform actions against these items
such as editing and compiling.
__ 4. Right-click the QDDSSRC file and then click Show in Table on the pop-up menu.
The iSeries Table view takes the selected object in the Remote Systems view as
input and displays the contents in the table. For source physical files, the iSeries
1-22 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Table view displays the members inside, their names, types, attributes, text
descriptions, and status.
The top of the iSeries Table view contains a lock icon that controls the correlation
between the Remote Systems view and the iSeries Table view.
If the lock is disabled, whenever you click an object or library in the Remote Systems
view, the associated contents of that item automatically populate the iSeries Table
view. If the lock is enabled, when you click on various items in the Remote Systems
view, this view does not change the contents of the iSeries Table view. To enable or
disable the lock, you can click it once to change its state.
In the iSeries Table view, you can click on a column heading to sort the rows in the
table based on the data in the column.
__ 5. In the iSeries Table view toolbar, click the lock button to unlock the table view. (If the
button appears pressed into the toolbar, it is in the locked position.) Leave the
mouse pointer over the tool button for a second or two to display the fly-over help.
That way you can check if the view is locked or unlocked.
This means now the table will automatically be updated when a different object is
selected in the Remote Systems view. This is a shortcut instead of using the pop-up
menu for an object in the Remote Systems view and selecting Show in Table.
You can also modify which specific columns you want to see in the iSeries Table
view.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. To modify the iSeries Table properties, click Window > Preferences from the
workbench menu.
The Preferences Window opens.
__ 7. In the left pane of the Preferences window, expand Remote Systems.
__ 8. Expand iSeries under Remote Systems.
__ 9. Click Table View under iSeries.
__ 10. In the right pane of the Preferences window, select Last modified in the Available
columns list.
__ 11. Click the Add button.
__ 12. Now click on Last modified in the Selected columns list and click once on the
Move Up button to move Last modified ahead of the Text entry in the list.
__ 13. Click OK.
1-24 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 14. Now, update the iSeries Table view with the new column layout by clicking the down
arrow on the iSeries Table view title bar.
Now you'll see the extra column that you've added. Note that the Last Modified
column appears between the Attribute and Text columns due to the movement you
performed in the order of the Selected columns list..
You can also sort the objects in the iSeries Table view by column.
__ 16. To sort the objects in ascending order by member type, click on the Type column
heading.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 17. If you click the heading a second time, it will sort it in descending order by member
type.
__ 18. In the Remote Systems view, select QCBLLESRC.
The table shows the members in QCBLLESRC.
Next, you will use the Remote Systems LPEX Editor to edit the member MSTDSP
found in QDDSSRC.
__ 19. From the Remote Systems view double-click member MSTDSP in the QDDSSRC
source file.
You can do this in the Remote Systems view or in the iSeries Table view.
The Remote Systems LPEX Editor opens. It is built right into the workbench, with
rich editing functions and is i5/OS-aware. It is a superset of SEU. The syntax
checker is ported from SEU, and the reference manuals are built-in and F1
cursor-sensitive.
1-26 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 20. Double-click the MSTDSP.DSPF tab to maximize the Editor window.
__ 21. Double-click the MSTDSP.DSPF tab again to return the view to its original size.
You have viewed and accessed objects in your library.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
The Outline view acts as an excellent resource when you want to edit RPG, COBOL, and
DDS source in the Remote Systems LPEX editor. The Outline view displays a structural
outline of items defined in the file that you currently have open in the Remote Systems
LPEX editor window. With the editor active, you can expand the file structure in the Outline
view, and click various elements in the view to jump to that location in the source itself.
With WDSC 7.0, an Outline view for CL source is also supported. In this case, the outline
consists of CL labels and subroutines that you can jump to in the source.
To see an Outline view of your COBOL source:
__ 1. Click the PAYROLLC tab in the editor and click Refresh on the Outline view toolbar.
Note: If you have closed the Outline view, you can reset the perspective by selecting
Window > Reset perspective from the workbench menu or Show view > Other
then expand General and click Outline in the Show view dialog.
The Outline view contains index references to key areas of your source structure in
a tree view.
1-28 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
using the Close option, Close Others option (all except the one you right-clicked on)
or click the X on each respective source member’s edit tab to close the member.
1-30 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Filters allow you to easily organize elements within your system. You use the filter function
to list i5/OS native file system objects (such as libraries, objects, or members)
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Now you will create a filter to specify the libraries with which you want to work, so
they are displayed in the iSeries Objects list. In our case, we want to work with all
libraries that begin with “RSE” and the VARPG library. We will do this in two steps,
first requesting the generic RSE names.
__ 4. Type RSE* into the Library field, using the asterisk (*) wild card character.
__ 5. Click Next.
The Name the new filter page opens.
Note
You can choose between creating the filter for all connections or for this specific one only. If
you have similar libraries or objects on multiple connections, you may want this filter to
apply to all connections. The default is for the filter to be defined and accessible from all
connections (ones that are currently defined and also ones that may be created later).
If you create a filter for all connections, if you later delete the filter from one particular
connection, it will be deleted from all connections automatically.
1-32 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 6. In the Filter name field, type All RSE and VARPG libraries.
You give your filters a name because the Remote System Explorer saves them for
future use, unlike PDM, which does not save filters.
__ 7. Check the box “Only create filter in this connection”.
__ 8. Click Finish. If you would prefer to press Next, you will see a panel with a tip on
creating Filter Pools, and you can then click Finish on that panel.
Back in the Remote Systems view under iSeries Objects you will see the new filter
listing all RSE* libraries located below the Library list and User libraries filters.
Now you will add the VARPG libraries by changing your filter.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-33
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 1. Expand and then right-click the filter All RSE and VARPG libraries and click
Change.
1-34 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 5. Click OK.
You are now back in the Remote Systems view.
You will see the list expanded to include the VARPG library. Now you can work with
the libraries directly and can drill down to the object with which you want to work.
You have created a filter to show a specific i5/OS library and changed that filter to add more
i5/OS libraries.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-35
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-36 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-37
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. Click OK.
The Create a new iSeries object filter page displays with the object type updated.
1-38 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-39
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 9. Click OK.
__ 10. Click Next.
The Name the new filter page opens.
1-40 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 13. Click Finish. If you would prefer to press Next, you will see a panel with a tip on
creating Filter Pools, and you can then click Finish on that panel.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-41
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
The new object filter displays in the Remote Systems view under iSeries Objects.
Expand this filter to see your source files in your team library.
Note: If you end up with too many filters, you can create filter pools. They allow you
to group filters.
Now you know how to create filters and tailor your development environment. Filters can
also be specified for non-i5/OS servers and your local system. Now you can work with the
objects you have in your Remote Systems view like you worked in PDM with a subset of
libraries, objects, or members.
For the next steps, assume you want to edit the member PAYROLLC in the source file
QCBLLESRC using this object filter.
1-42 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
You want to create a user action that copies a source file with data to a new source
file called QJUNKSRC in the same library.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-43
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. In the Action name: field, type Copy source file for the user action name.
1-44 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 1. In the From object field, type &N to indicate to use the name of the selected object in
the Remote Systems view.
__ 2. In the From library field, type &L to pick up the library name from the selected
object.
__ 3. In the Object type field, type &T to pick up the object type from the selected object.
__ 4. In the New object field, type QJUNKSRC.
__ 5. Select the All parameters check box to see the additional Duplicate data
parameter.
The Duplicate data parameter is now shown on the prompt window.
__ 6. Select *YES from the Duplicate data parameter list drop-down arrow.
__ 7. Click OK.
You return to the Work with User Actions window and now the full command syntax
generated by the prompter appears in the Command: box.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-45
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Note
Clicking the Insert variable button displays a list of valid replacement variables with the
explanation of what they do.
__ 8. Select the Refresh after check box, so that the Remote Systems view gets
refreshed after the action has been run.
This Copy source file with data user action is only valid for Source physical files. You
need to specify this restriction so this user action will only show in pop-up menus
when you right-click on a source physical file.
1-46 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty
__ 4. Click Close.
When you right-click on a source file, this user action (Copy source file) appears on
the pop-up menu. For any other object type, it will not appear.
__ 5. Close the PAYROLLC source member in the LPEX editor if it is still open. The Copy
source file user action we will test in the next section will fail if the PAYROLLC
source member with file QCBLLESRC is still locked by the LPEX editor.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-47
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Hint
The file is copied, and the list is refreshed. Your new QJUNKSRC source file will
show in the list. You can check the messages of the CL commands you are running
1-48 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty in the RSE Communications server job by looking at the iSeries Commands log in
the right hand side bottom pane of the workbench.
__ 6. To delete the source file QJUNKSRC that you just created, right-click QJUNKSRC.
__ 7. Click Delete on the pop-up menu.
The Delete Confirmation dialog opens.
__ 8. Click Delete on the confirmation dialog.
You have created a user action that copies a source file with data to a new source file,
specified user action parameters, specified restrictions on the user action, and tested the
user action.
Note
We could have launched the user action from the object filter My source files - however,
an object filter does not refresh the list automatically like the library filter does - you have to
manually refresh the object filter list. For purposes of this lab, we chose the library filter with
the automatic refresh to reflect the results of the user action.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-49
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
command and click either Prompt to specify parameters and then Run, or just click
Run. When you run a command, the Messages field is populated with the messages
from the command. When you select a message, the Details button is enabled.
When you click this button, the message and its help is displayed.
__ 3. Type an i5/OS command, for example ADDLIBLE, and click the Prompt button.
That will add this library to the library list of your Remote System Explorer job on the
i5/OS server.
1-50 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty The messages field will confirm the successful completion of this command. To get
to the command history (similar to F9 on a 5250 screen), select the appropriate
value from the Command list (click the down arrow beside the Messages field).
You could also use the iSeries Commands subsystem in the Remote Systems view
underneath the iSeries Objects subsystem and run predefined commands or define
your own commands.
You have run an i5/OS command from the iSeries Table view.
Important
You may skip over the RPG track pages, which perform the same types of steps as you just
performed in the COBOL track. Please go to the “Quiz” on page 1-82
End of exercise
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-51
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-52 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Now you can see and access the members in these two source files. For each
member you can right-click and select from a number of actions. The exact list of
actions depends on whether the member is a data file or source file and whether you
select one or multiple members. For a RPG source member, the pop-up menu
actions include:
• Open with
• Browse with
• Verify
• Compile
Before you work with these members, examine the iSeries Table view, which is similar to
the view in PDM. You use this view to display a list of items (for example, members or
objects) in a table format similar to PDM. You can also perform actions against these items
such as editing and compiling.
__ 4. Right-click the QDDSSRC file and then click Show in Table on the pop-up menu.
The iSeries Table view takes the selected object in the Remote Systems view as
input and displays the contents in the table. For source physical files, the iSeries
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-53
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Table view displays the members inside, their names, types, attributes, text
descriptions, and status.
The top of the iSeries Table view contains a lock icon that controls the correlation
between the Remote Systems view and the iSeries Table view.
If the lock is disabled, whenever you click an object or library in the Remote Systems
view, the associated contents of that item automatically populate the iSeries Table
view. If the lock is enabled, when you click on various items in the Remote Systems
view, this view does not change the contents of the iSeries Table view. To enable or
disable the lock, you can click it once to change its state.
In the iSeries Table view, you can click on a column heading to sort the rows in the
table based on the data in the column.
__ 5. In the iSeries Table view toolbar, click the lock button to unlock the table view. (If the
button appears pressed into the toolbar, it is in the locked position.) Leave the
mouse pointer over the tool button for a second or two to display the fly-over help.
That way you can check if the view is locked or unlocked.
This means now the table will automatically be updated when a different object is
selected in the Remote Systems view. This is a shortcut instead of using the pop-up
menu for an object in the Remote Systems view and selecting Show in Table.
You can also modify which specific columns you want to see in the iSeries Table
view.
1-54 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 6. To modify the iSeries Table properties, click Window > Preferences from the
workbench menu.
The Preferences Window opens.
__ 7. In the left pane of the Preferences window, expand Remote Systems.
__ 8. Expand iSeries under Remote Systems.
__ 9. Click Table View under iSeries.
__ 10. In the right pane of the Preferences window, select Last modified in the Available
columns list.
__ 11. Click the Add button.
__ 12. Now click on Last modified in the Selected columns list and click once on the
Move Up button to move Last modified ahead of the Text entry in the list.
__ 13. Click OK.
__ 14. Now, update the iSeries Table view with the new column layout by clicking the down
arrow on the iSeries Table view title bar.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-55
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Now you'll see the extra column that you've added. Note that the Last Modified
column appears between the Attribute and Text columns due to the movement you
performed in the order of the Selected columns list..
You can also sort the objects in the iSeries Table view by column.
__ 16. To sort the objects in ascending order by member type, click on the Type column
heading.
__ 17. If you click the heading a second time, it will sort it in descending order by member
type.
__ 18. In the Remote Systems view, select QRPGLESRC.
1-56 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Next, you will use the Remote Systems LPEX Editor to edit the member MSTDSP
found in QDDSSRC.
__ 19. From the Remote Systems view double-click member MSTDSP in the QDDSSRC
source file.
You can do this in the Remote Systems view or in the iSeries Table view.
The Remote Systems LPEX Editor opens. It is built right into the workbench, with
rich editing functions and is i5/OS-aware. It is a superset of SEU. The syntax
checker is ported from SEU, and the reference manuals are built-in and F1
cursor-sensitive..
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-57
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-58 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty LPEX editor window. With the editor active, you can expand the file structure in the Outline
view, and click various elements in the view to jump to that location in the source itself.
With WDSC 7.0, an Outline view for CL source is also supported. In this case, the outline
consists of CL labels and subroutines that you can jump to in the source.
To see an Outline view of your RPG source:
__ 1. Click the PAYROLL tab in the editor and click Refresh on the Outline view toolbar.
Note: If you have closed the Outline view, you can reset the perspective by selecting
Window > Reset perspective from the workbench menu or Show view > Other
then expand General and click Outline in the Show view dialog.
The Outline view contains index references to key areas of your source structure in
a tree view.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-59
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-60 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty using the Close option, Close Others option (all except the one you right-clicked on)
or click the X on each respective source member’s edit tab to close the member.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-61
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Filters allow you to easily organize elements within your system. You use the filter function
to list i5/OS native file system objects (such as libraries, objects, or members).
1-62 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Now you will create a filter to specify the libraries with which you want to work, so
they are displayed in the iSeries Objects list. In our case, we want to work with all
libraries that begin with “RSE” and the VARPG library. We will do this in two steps,
first requesting the generic RSE names.
__ 4. Type RSE* into the Library field, using the asterisk (*) wild card character.
__ 5. Click Next.
The Name the new filter page opens.
Note
You can choose between creating the filter for all connections or for this specific one only. If
you have similar libraries or objects on multiple connections, you may want this filter to
apply to all connections. The default is for the filter to be defined and accessible from all
connections (ones that are currently defined and also ones that may be created later).
If you create a filter for all connections, if you later delete the filter from one particular
connection, it will be deleted from all connections automatically.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-63
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. In the Filter name field, type All RSE and VARPG libraries.
You give your filters a name because the Remote System Explorer saves them for
future use, unlike PDM, which does not save filters.
__ 7. Check the box “Only create filter in this connection”.
__ 8. Click Finish. If you would prefer to press Next, you will see a panel with a tip on
creating Filter Pools, and you can then click Finish on that panel.
Back in the Remote Systems view under iSeries Objects you will see the new filter
listing all RSE* libraries located below the Library list and User libraries filters.
Now you will add the VARPG libraries by changing your filter.
1-64 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 1. Expand and then right-click the filter All RSE and VARPG libraries and click
Change.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-65
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 5. Click OK.
You are now back in the Remote Systems view.
You will see the list expanded to include the VARPG library. Now you can work with
the libraries directly and can drill down to the object with which you want to work.
You have created a filter to show a specific i5/OS library and changed that filter to add more
i5/OS libraries.
1-66 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-67
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-68 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 6. Click OK.
The Create a new iSeries object filter page displays with the object type updated.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-69
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-70 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 9. Click OK.
__ 10. Click Next.
The Name the new filter page opens.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-71
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 12. Click Finish. If you would prefer to press Next, you will see a panel with a tip on
creating Filter Pools, and you can then click Finish on that panel.
The new object filter displays in the Remote Systems view under iSeries Objects:
1-72 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Note: If you end up with too many filters, you can create filter pools. They allow you
to group filters.
Now you know how to create filters and tailor your development environment. Filters can
also be specified for non-i5/OS servers and your local system. Now you can work with the
objects you have in your Remote Systems view like you worked in PDM with a subset of
libraries, objects, or members.
For the next steps, assume you want to edit the member PAYROLL in the source file
QRPGLESRC using this object filter.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-73
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. Click User Actions > Work with User Actions on the pop-up menu.
You want to create a user action that copies a source file with data to a new source
file called QJUNKSRC in the same library.
__ 6. In the Action name: field, type Copy source file for the user action name.
1-74 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 8. In the Command field, type CRTDUPOBJ for the command to execute.
__ 9. Click Prompt to open the command prompter for this command.
This is the command you will be running:
CRTDUPOBJ OBJ(&N) FROMLIB(&L) OBJTYPE(&T) NEWOBJ(QJUNKSRC) DATA(*YES)
We will use the command prompter to provide a form that you can fill out rather than
type a long string of parameters.
__ 2. In the From library field, type &L to pick up the library name from the selected
object.
__ 3. In the Object type field, type &T to pick up the object type from the selected object.
__ 4. In the New object field, type QJUNKSRC.
__ 5. Select the All parameters check box to see the additional Duplicate data
parameter.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-75
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Note
Clicking the Insert variable button displays a list of valid replacement variables with the
explanation of what they do.
__ 8. Select the Refresh after check box, so that the Remote Systems view gets
refreshed after the action has been run.
This Copy source file with data user action is only valid for Source physical files. You
need to specify this restriction so this user action will only show in pop-up menus
when you right-click on a source physical file.
1-76 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty
__ 4. Click Close.
When you right-click on a source file, this user action (Copy source file) appears on
the pop-up menu. For any other object type, it will not appear.
__ 5. Close the PAYROLL source member in the LPEX editor if it is still open. The Copy
source file user action we will test in the next section will fail if the PAYROLL source
member with file QRPGLESRC is still locked by the LPEX editor.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-77
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Hint
The file is copied, and the list is refreshed. Your new QJUNKSRC source file will
show in the list. You can check the messages of the CL commands you are running
1-78 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty in the RSE Communications server job by looking at the iSeries Commands log in
the right hand side bottom pane of the workbench.
__ 6. To delete the source file QJUNKSRC that you just created, right-click QJUNKSRC.
__ 7. Click Delete on the pop-up menu.
The Delete Confirmation dialog opens.
__ 8. Click Delete on the confirmation dialog.
You have created a user action that copies a source file with data to a new source file,
specified user action parameters, specified restrictions on the user action, and tested the
user action.
Note
We could have launched the user action from the object filter My source files - however,
an object filter does not refresh the list automatically like the library filter does - you have to
manually refresh the object filter list. For purposes of this lab, we chose the library filter with
the automatic refresh to reflect the results of the user action.
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-79
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
command and click either Prompt to specify parameters and then Run, or just click
Run. When you run a command, the Messages field is populated with the messages
from the command. When you select a message, the Details button is enabled.
When you click this button, the message and its help is displayed.
__ 3. Type an i5/OS command, for example ADDLIBLE, and click the Prompt button.
That will add this library to the library list of your Remote System Explorer job on the
i5/OS server.
1-80 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty The messages field will confirm the successful completion of this command. To get
to the command history (similar to F9 on a 5250 screen), select the appropriate
value from the Command list (click the down arrow beside the Messages field).
You could also use the iSeries Commands subsystem in the Remote Systems view
underneath the iSeries Objects subsystem and run predefined commands or define
your own commands.
You have run an i5/OS command from the iSeries Table view.
End of exercise
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-81
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1.5. Quiz
Now you are ready to review your knowledge of this module by taking the quiz. You can
also apply what you have learned in this module by completing the practice tasks detailed
in “Exercise Review/Wrap-up” on page 1-84.
__ 1. A workspace:
a. Aims to achieve seamless tool integration and controlled openness by
providing a common paradigm for the creation, management, and navigation
of workbench resources.
b. Defines the initial set and layout of views in the Workbench window.
c. Refers to the desktop development environment.
d. Specifies where your projects and other resources such as folders,
subfolders and files that you are developing in the workbench will reside.
__ 2. A workbench:
a. Aims to achieve seamless tool-integration and controlled openness by
providing a common paradigm for the creation, management, and navigation
of workbench resources.
b. Defines the initial set and layout of views in the Workbench window.
c. Refers to the desktop development environment.
d. Specifies where your projects and other resources such as folders,
subfolders and files that you are developing in the workbench will reside.
e. A and C
__ 3. A perspective:
a. Aims to achieve seamless tool integration and controlled openness by
providing a common paradigm for the creation, management, and navigation
of workbench resources.
b. Defines the initial set and layout of views in the Workbench window.
c. Refers to the desktop development environment.
d. Specifies where your projects and other resources such as folders,
subfolders and files that you are developing in the workbench will reside.
__ 4. The lock icon controls the correlation between the Remote Systems view and the
iSeries Table view. (T, F)
__ 5. You can maximize the Editor window by double-clicking on its window heading. You
can get back to its original size, by double-clicking on the heading again (T, F).
__ 6. You can create filters for all connections or for a specific connection. (T, F)
1-82 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 7. You give your filters a specific name because the Remote System Explorer saves
them for future use, unlike PDM, which does not save filters. (T, F)
__ 8. If you end up with too many filters, you can create filter pools. (T F)
__ 9. Filters can be specified for non iSeries servers and your local system. (T, F)
__ 10. You can specify a restriction on a user action. (T, F)
© Copyright IBM Corp. 2005, 2008 Exercise 1. Exploring and managing i5/OS objects and connections 1-83
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-84 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Introduction
Your program editing tasks are simplified with the Remote Systems LPEX Editor. The editor
can access source files on your workstation or your i5/OS system directly. When a
compilation results in errors, you can jump from the compiler messages to an editor
containing the source. The editor opens with the cursor positioned at the offending source
statements so that you can correct them.
Here is a list of some of the basic editor features that you would expect in a workstation
editor:
• Cut, copy, and paste
• Block marking of lines, characters, or rectangles with copy, move, and delete
operations
• Powerful find and replace function
• Unlimited undo and redo
In addition there are a few more functions that you may not have seen in a workstation
editor:
• Token highlighting where different language constructs are highlighted using
different colors to help identify them in a program
• SEU-like format-line rulers to show the purpose of each column for
column-sensitive languages like RPG and DDS. These rulers can automatically
update themselves to reflect the current specification.
• SEU-like specification prompting for RPG and DDS
• Multiple simultaneously editable split-screen views of same source member
• Sequence numbers, which allow SEU-style commands in the prefix area
• Intelligent tabbing between columns for column-sensitive languages
2-2 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Hint
You might want to maximize the Editor window (by double-clicking the tab) during this
module.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-4 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Hint
Use your My Source files filter to locate file QCBLLESRC and then member
PAYROLLC.cblle - doubleclick PAYROLLC.cblle to open it in LPEX for editing.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-6 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Notice how your changes are reflected in the sample edit view.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-8 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-10 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Notice that the five new lines that you added in the previous section disappear and
the status line is decremented and only shows 1 change now.
__ 2. Press Ctrl+Z to undo the last change remaining.
Notice that the lines you previously deleted with the dd commands now reappear
and the status line does not show any changes remaining.
Note
Ctrl+Z is a keyboard shortcut that performs an Undo, just like Undo from the workbench
menu.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
A Save Resource dialog opens asking if you want to save the latest changes.
__ 5. Click No. This will not save any of the delete and insert practice changes you made.
__ 6. Go back to the workbench to the Remote Systems view and open the PAYROLLC
member in the QCBLLESRC file.
You have learned how to undo and redo changes that you made to a file.
2-12 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Text marked in blue in the Help window contains links to more detailed information
about the topic.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. Minimize the Help window by clicking the first button in the upper right corner.
__ 5. Select Help > Help Contents on the workbench menu to see a list of all help that is
available in the product.
2-14 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 6. In the left pane of the Help window, click WebSphere Development Studio Client
for iSeries and then expand Reference.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 12. In the right-hand pane of the help window, you will see a list of all the ILE COBOL
releases with links to the functional enhancements that were new in each release.
Click What’s New in V5R4? for an example.
__ 13. Explore the Help window to see what else is available in the ILE COBOL
Programmer’s Guide and Language Reference.
Having the latest version of the manuals at your fingertips will make it easier to find
programming information. There is also the option to search the help by specifying a
search string. By default, the complete help will be searched.
2-16 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 3. Click New.
The New Search List dialog opens.
__ 4. In the List name field, type Programming Language Reference, for example.
__ 5. Expand WebSphere Development Studio Client for iSeries.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-18 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty The Select Search Scope dialog reopens again with Programming Language
Reference selected in the topic list.
Note
Notice how the Search scope is set to the Programming Language Reference list name
that you created.
__ 10. Searching requires a help index, which is built the first time the search function is
used after a release of WDSC is installed on your PC. It takes approximately 5
minutes to create the index. However, once created, subsequent searches are very
fast. The lab setup should have already built the search index for you.
To complete the search query, click GO.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
The search results display. Select the second TRIML result as seen below..
2-20 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 2. Click Edit > Find/Replace from the workbench menu or press Ctrl+F.
The Find/Replace window opens at the bottom of the Editor window.
At the bottom of this window, you will notice that you have some options to select
from, for example, search only in certain columns, and so on. You want to find the
first occurrence of MSTDSP.
__ 3. In the Find field, enter MSTDSP to find the start of a file section.
__ 4. Make sure the Replace field is blank. You would use this field for text replacement.
The Editor automatically moves the active line to line 29, which contains the first
MSTDSP phrase in the file.
__ 5. Click Next to go to the next location of MSTDSP in the file. The Editor now is
positioned to MSTDSP in line 37.
__ 6. Click in the Editor window to close the Find/Replace window.
You have searched for an item in your source using the Find/Replace window.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. Select Edit > Selected > Filter Selection from the workbench menu..
Note
The source is filtered to only show lines referencing the WS-EMPNO variable.
2-22 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Your cursor is still positioned on the same line to which you moved the cursor (line
302), even though all source lines are now showing.
You have learned how to filter your source so that you see only lines containing a given
string.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
All source lines with divisions are displayed allowing you to move quickly and easily
to the desired subroutine in your file.
__ 3. Move your cursor to the line with the DATA DIVISION (line 64).
__ 4. Expand the declaration to show all lines in this division.
Now you could work with the source inside this division.
__ 5. Right-click in the Editor window and click Show all on the pop-up menu.
You have learned how to filter lines in your source by line type.
2-24 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 3. Under Target in the Library field, type <team_lib>, if not already entered.
__ 4. Under Target in the File field, type QDDSSRC to search all members in this source
physical file.
__ 5. Under Target in the Member field, select *.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. Click Search.
The Multi-File Search window lists all the lines in all the files that reference ENHRS.
2-26 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Part 9: Comparing file differences from the Remote Systems view
If your product undergoes many changes, you will find the Compare utility in the workbench
useful. It allows you to compare different versions of a program and find the differences.
Using the Compare utility in the workbench, you can view the differences between two files
by comparing them. You can compare different files, and you can compare versions in the
Workbench with versions in the repository or with the local edit history.
After a comparison is carried out, the Compare Editor opens in the editor area. In the
Compare Editor, you can browse through all the differences and copy highlighted
differences between the compared resources. You can save changes to resources that are
made in the comparison editor.
Important
Note: Make sure all lines show in the source before starting the Compare tool. You should
be currently showing all source from your Show All operation in previous steps to remove
source filters.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
In the right pane of the Preferences window make sure that the three Ignore blanks
check boxes are selected.
2-28 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Hint
On the above screenshot, notice how the Compare to file... menu entry has a symbol that
looks like a triangle. This same symbol is on your workbench toolbar, and is a fast-path into
launching the Compare to file... function.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-30 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 13. Use the Next Mismatch menu entry or click Ctrl+Shift+ N to find the next
mismatch.
Next, we will end the compare session.
__ 14. Right-click in the source edit view, and select Compare > Clear to remove the
miscompare lines from the second member you are comparing to.
__ 15. Double-click the PAYROLLC tab to return the Editor window to its original size.
You have compared different versions of the program and found the differences.
2-32 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-33
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Error messages appear that draw attention to the errors. The first error should be
near Line 88. You could right-click and select Filter view > Errors to easily see the
Verify errors..
2-34 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty This opens a window with second-level help for the error.
Hint
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-35
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Information
You can toggle automatic syntax checking. Click Window > Preferences from the
workbench menu and then expand Remote Systems > Remote Systems LPEX Editor >
iSeries Parsers and select the language you want to change the settings for in the left
pane of the Preferences window. You can then toggle this via the Automatic syntax
checking check box.
2-36 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
After a moment the verifier will display an iSeries Error List view below the Editor
view.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-37
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Fixing errors
Next you will fix the errors in your PAYROLLC2 source.
To fix an error in your source go to the iSeries Error List view:
__ 1. Double-click the error with an ID of LNC1463.
You are automatically brought back into the Editor window to line 302 where the
error occurred. The error is caused by EMPNO not being uniquely defined. The
variable EMPNO should be EMPNO OF EMPSEL-I.
Make the change.
__ 2. Double-click LNC1326. PRCD should really be PRCDE. Make the appropriate change
on line 402.
__ 3. Double-click LNC1329. This error is caused because the array was declared with
four elements, not 14. On line 606, change the index of the array from 14 to 4.
__ 4. The next errors are LNC0407. You can ignore these as they are severity 20. All
severity 30 errors and above are now fixed. You can filter out different severities by
using the filter menu.
Click the arrow in the upper right corner of the iSeries Error List title bar.
__ 5. Click Show Severity on the pop-up menu.
__ 6. Clear the severities you don't want to see in the list by clicking on the menu entry
(Information and Warning and Error, in this case, leaving only Severe and
Terminating errors). Perform this multiple times to clear multiple severity types. After
clearing Error, you will see all LNC0407 messages disappear from the iSeries Error
List view.
2-38 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
• Press Ctrl+S.
Changes are uploaded to i5/OS.
__ 2. Use Source > Remove Messages to clear the verify messages from your source
view, so that you can re-run verify and not have previous verify messages
remaining.
__ 3. Verify your source again via Source > Verify.
You should not see any Severe or Terminating messages. You are ready to compile
the program.
You have verified your source and fixed any errors.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-39
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-40 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 5. In the right pane of the Preferences window, clear the Compile in batch check box.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-41
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
To compile source:
__ 1. Right-click the PAYROLLC2 member in QCBLLESRC.
__ 2. Click Compile (Prompt) > CRTBNDCBL on the pop-up menu.
2-42 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-43
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
The progress bar on the workbench (in the bottom status area) will indicate that the
compile is running. The iSeries Error List will be shown with no errors – if you still
have the message severity filter in effect. If you specify to see Error severity level
and below, you will see the following messages.
If you are not sure that the compile was successful, you can check the iSeries
Commands Log.
__ 5. Click the iSeries Commands Log tab at the bottom of the workbench.
This log shows a list of all commands run on the remote system and the messages
returned for each command.
You have set compile preferences, invoked the compile command, and checked for a
successful compile.
2-44 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Part 13: Submitting i5/OS commands in the iSeries Table View
You can use the iSeries Table View inside the Remote System Explorer to submit
commands to i5/OS. You can run commands from the Command field beneath the iSeries
Table View, and you can view messages in the Messages field. After you populate the
table, you can enter a command and click either Prompt to specify parameters or just click
Run. When you run a command, the Messages field is populated with the messages from
the command. When you select a message, the Details button is enabled. When you click
this button, the message and its help is displayed.
Also note that besides the iSeries Table View, you can also use the Remote Systems view
to run commands and programs. Which one you choose depends on your personal
preference. In the iSeries Table View, you can see the properties of all items at the same
time: they are displayed as rows across the table. In the Remote Systems view, you have
greater ease of navigation: you can work from your Library list in the iSeries Objects
subsystem, and you can see the contents of many items before selecting the one you want
to run.
In the Command field, you select where you want to run the command. The choices are
Normal (which means that the command will be run in the RSE communication server job,
using your connection’s library list), Batch (uses SBMJOB command and settings from
your user profile), or Interactive (uses interactive job associated with connection via
STRRSESVR command).
To issue a command:
__ 1. From the Remote Systems view, right click on file QCBLLESRC in your My source
files filter, and select Show in Table.
__ 1. Click the iSeries Table View tab from the views at the bottom of the workbench.
__ 2. Now we will change the text description of an i5/OS library. In the Command field
type the command:
CHGLIB
__ 3. Click Prompt.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-45
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. The Change Library (CHGLIB) prompt window will now appear. Enter RSEWDSC
for the Library field and type over *SAME with WDSC RSE Classroom Library in
the Text ‘description’ field.
__ 5. Press OK.
The command will run on i5/OS and after completion you will see the completion
message on the bottom of the iSeries Table View.
You can also connect to systems other than i5/OS with the Remote System Explorer
and launch commands for these systems as well, for example, your local system, or
Linux.
You have submitted a command to change a library text description in the command line of
the iSeries Table View.
2-46 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-47
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Hint
Use the Start or Configure Session function of PCOMM or Pc5250 to define a connection
to <i5/OS_system>. Your classroom instructor may already have a shortcut to PCOMM or
Pc5250 on your Windows desktop for you.
Note: Instead of the Enter key, you may have to use the Ctrl key in your
5250-emulation session.
2-48 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 3. In the command line, type the following command (refer to your lab information
sheet for the connection name to use):
STRRSESVR <i5/OS_system>
__ 4. Press Enter.
The value of the STRRSESVR parameter (<i5/OS_system> from your lab
worksheet) is the name of the connection you defined in the Remote Systems view.
This associates the interactive job with the Remote System Explorer
communications server.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-49
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Now the interactive 5250 job will connect to WDSC on the client PC, and go into a
wait state, waiting for you to run a program from your WDSC workbench.
Note
Notice that a command to add your team library was run in the STRRSESVR interactive
job. This came from the initial library list specification you defined in an earlier lab for your
WDSC connection.
Hint
Find your team library <team_lib> in your Library list filter. You may need to refresh the
view in your library or filter within the Remote Systems View.
2-50 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 4. Find your 5250-emulation window on your Windows desktop and bring it to the
foreground by clicking on its title bar.
You will see a Time Reporting System payroll menu.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-51
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. Press Enter.
__ 7. Type 234 for the Employee Number.
__ 8. Type A for the Action Code to add employee 234.
__ 9. Press Enter.
__ 10. Type your name for the Name field, leaving other fields blank.
__ 11. Press Enter.
__ 12. Press F3 to end the application and return to the STRRSESVR wait screen.
__ 13. To release control of the STRRSESVR interactive job, right-click iSeries Objects on
the WDSC Remote Systems view and click Release Interactive Job on the pop-up
menu. This will end the STRRSESVR job and return the 5250 emulation window to
an i5/OS command menu.
__ 14. In the WDSC workbench, close the PAYROLLC2 and PAYROLLC editor tabs. If
prompted to save PAYROLLC, specify to save it.
__ 15. Close the Help window that is minimized to the Windows task tray.
You have completed this exercise and are ready to take the quiz. See “Quiz” on
page 2-114.
End of exercise
2-52 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Hint
Use your My Source files filter to locate file QRPGLESRC and then member
PAYROLL.rpgle - doubleclick PAYROLL.rpgle to open it in LPEX for editing.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-53
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-54 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 3. In the right pane of the Preferences window, select the Column sensitive editing
check box.
When selected, each column is considered as a separate entry space.
__ 4. Click Apply.
The settings are saved and the Preferences window still is active for more changes
we need to make.
Hint
Scroll up in the Preferences window to find the LPEX Editor grouping. It is a different
grouping than Remote Systems LPEX Editor at the main sub-level.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-55
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Notice how your changes are reflected in the sample edit view.
2-56 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty
Note
This is really only useful for Free-Format RPG source lines and other free-format
languages like COBOL. For fixed-specification RPG source lines, you cannot split the text
to another line without causing syntax errors in your source.
__ 1. Expand LPEX Editor in the Preferences window (if not already expanded), and then
select User Key Actions.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-57
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. Select splitLine from the dropdown box in the Action field (or optionally type
splitLine directly into the Action field).
__ 4. Click Set.
For ILE RPG, an additional step is needed. For the Enter key to use the new split
line action you need to change the default Remote System Explorer behavior for the
ILE RPG language.
__ 5. Expand Remote Systems, and then Remote Systems LPEX Editor, and finally
iSeries Parsers.
__ 6. Select ILE RPG.
__ 7. Clear the Repeat previous specification type check box.
2-58 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty
Note
If you are working with fixed column specification RPG source lines, you will probably
prefer to leave the Enter key behavior set to Repeat previous specification type.
Notice that the line the cursor is on is now highlighted in the color you selected for it
in the preference setting for highlight current line.
__ 2. Make sure the editor is in Insert mode. If the status area shows Replace press the
Insert key to toggle from Replace to Insert mode. You can also go to the status area
and double-click on the word Replace to toggle it to Insert mode.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-59
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-60 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
The text to the right of the cursor in this Free-Form RPG section is moved to the next
line.
__ 2. Now, correct what you just did by using the Edit pulldown on the main workbench
menu, and then select Undo.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-61
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
• ispf
• seu
• xedit
The editor recognizes prefix commands used by these editor profiles. Depending on which
profile you are using, you can enter SEU, XEDIT, or ISPF commands when the prefix area
is active.
If you are an SEU expert you will appreciate the ability to use SEU commands.
To enter SEU commands:
__ 1. Move the cursor into the gray sequence number area to the left of the edit area.
__ 2. Type dd over any sequence number, which automatically blanks out whatever
remains of the sequence number in the prefix area.
__ 3. Go down a few lines and type dd again and press Enter.
2-62 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty to undo a set of changes made to a file you use the Undo operation. You can also cancel
the effects of an Undo operation by using the Redo operation.
Now you are going to undo some of the changes you just made to the file. Then you will
cancel the Undo operation by using the Redo operation. Finally you will reload the source
so that it is back to its original content.
To undo and redo edit changes:
__ 1. Click Edit > Undo from the workbench menu.
Notice that the five new lines that you added in the previous section disappear and
the status line is decremented and only shows 1 change now.
__ 2. Press Ctrl+Z to undo the last change remaining.
Notice that the lines you previously deleted with the dd commands now reappear
and the status line does not show any changes remaining.
Note
Ctrl+Z is a keyboard shortcut that performs an Undo, just like Undo from the workbench
menu.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-63
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
A Save Resource dialog opens asking if you want to save the latest changes.
__ 5. Click No. This will not save any of the delete and insert practice changes you made
__ 6. Go back to the workbench to the Remote Systems view and open the PAYROLL
member in the QRPGLESRC file.
You have learned how to undo and redo changes that you made to a file.
2-64 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Text marked in blue in the Help window contains links to more detailed information
about the topic.
__ 3. Click the link Date Data Type. (You may need to scroll down the page to see the
link.)
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-65
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. Minimize the Help window by clicking the first button in the upper right corner.
__ 5. Select Help > Help Contents on the workbench menu to see a list of all help that is
available in the product.
2-66 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 6. In the left pane of the Help window, click WebSphere Development Studio Client
for iSeries and then expand Reference.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-67
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 14. In the right-hand pane of the help window, you will see a list of all the ILE RPG
releases with links to the functional enhancements that were new in each release.
Click What’s New this Release? for an example.
__ 15. Explore the Help window to see what else is available in the ILE RPG Programmer’s
Guide and Language Reference.
Having the latest version of the manuals at your fingertips will make it easier to find
programming information. There is also the option to search the help by specifying a
search string. By default, the complete help will be searched.
2-68 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 3. Click New.
The New Search List dialog opens.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-69
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. In the List name field, type Programming Language Reference, for example.
__ 5. Expand WebSphere Development Studio Client for iSeries.
__ 6. Select Reference.
2-70 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty The Select Search Scope dialog reopens again with Programming Language
Reference selected in the topic list.
Note
Notice how the Search scope is set to the Programming Language Reference list name
that you created.
__ 10. Searching requires a help index, which is built the first time the search function is
used after a release of WDSC is installed on your PC. It takes approximately 5
minutes to create the index. However, once created, subsequent searches are very
fast. The lab setup should have already built the search index for you.
To complete the search query, click GO.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-71
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
The search results display. Select the second EVAL-CORR result as seen below.
2-72 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
On the iSeries Source Prompter view’s toolbar you can use the three buttons in the
upper right corner to: Disable source prompt view, Disable syntax checking, and
Change to insert mode (so that entries formed by the prompter are inserted as new
lines into the source).
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-73
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
You will see words in the help that appear in a different color than the regular text.
These are help links, and they show that there is additional help available on that
word or phrase.
__ 3. Click on DIM(numeric_constant) to see specific help for that item.
__ 4. Minimize the Help window.
You have seen how to use prompts to enter code.
2-74 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 3. You can display the iSeries Indent view as a full view. Double-click the iSeries
Indent tab.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-75
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. Scroll down to line 150. The Row shown on the status bar reflects the cursor
position.
In the iSeries Indent view you see some nested conditions with indented lines. As
you will notice this helps to recognize the beginning and ending of these conditions.
Note: The Indented view is Browse mode only and cannot be edited.
__ 5. Double-click the tab for iSeries Indent view to return it to the non-maximized size.
__ 6. Click the X in the top right corner of the view to close the iSeries Indent view.
__ 7. This returns you to the Editor window with the PAYROLL program.
You have used the Indent view to see the beginning and ending of constructs.
2-76 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 4. Make sure the Replace field is blank. You would use this field for text replacement.
The Editor automatically moves the active line to line 52, which contains the first
BEGSR phrase in the file.
__ 5. Click Next to go to the next location of BEGSR in the file. You will be positioned in
the editor to Line 110.
__ 6. Click in the Editor window source area to close the Find/Replace window.
You have searched for an item in your source using the Find/Replace window.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-77
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Note
The source is filtered to only show lines referencing the EMPAPL variable.
2-78 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 4. Expand line 79. This expands the section up to the next instance of EMPAPL.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-79
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
All source lines with BEGSR or ENDSR are displayed allowing you to move quickly
and easily to the desired subroutine in your file.
2-80 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 3. Move your cursor to the line with the subroutine declaration CHGCDE (sequence
number 044400, line 446).
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-81
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. Under Target in the Library field, type <team_lib>, if not already entered.
__ 4. Under Target in the File field, type QDDSSRC to search all members in this source
physical file.
__ 5. Under Target in the Member field, select *.
2-82 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-83
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Part 11: Comparing file differences from the Remote Systems view
If your product undergoes many changes, you will find the Compare utility in the workbench
useful. It allows you to compare different versions of a program and find the differences.
Using the Compare utility in the workbench, you can view the differences between two files
by comparing them. You can compare different files, and you can compare versions in the
Workbench with versions in the repository or with the local edit history.
After a comparison is carried out, the Compare Editor opens in the editor area. In the
Compare Editor, you can browse through all the differences and copy highlighted
differences between the compared resources. You can save changes to resources that are
made in the comparison editor.
Important
Note: Make sure all lines show in the source before starting the Compare tool. You should
be currently showing all source from your Show All operation in previous steps to remove
source filters.
2-84 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty In the right pane of the Preferences window make sure that the three Ignore blanks
check boxes are selected.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-85
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Hint
On the above screenshot, notice how the Compare to file... menu entry has a symbol that
looks like a triangle. This same symbol is on your workbench toolbar, and is a fast-path into
launching the Compare to file... function.
2-86 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-87
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-88 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty You can move from mismatch to mismatch by right-clicking in the PAYROLL source
LPEX view and using the Compare menu and submenu.
__ 13. Use the Next Mismatch menu entry or click Ctrl+Shift+ N to find the next
mismatch.
Next, we will end the compare session.
__ 14. Right-click in the source edit view, and select Compare > Clear to remove the
miscompare lines from the second member you are comparing to.
__ 15. Double-click the PAYROLL tab to return the Editor window to its original size.
You have compared different versions of the program and found the differences.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-89
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Note
You might already be on that source line, but if not, type the line number 211 over any
sequence number in left sequence number column, and press Enter, or scroll down to line
number 211.
2-90 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-91
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Hint
You could also use Edit > Undo from the workbench menu to correct this
2-92 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty
Information
You can toggle automatic syntax checking. Optionally, click Window > Preferences from
the workbench menu and then expand Remote Systems > Remote Systems LPEX
Editor > iSeries Parsers and select the language you want to change the settings for in
the left pane of the Preferences window. You can then toggle this via the Automatic
syntax checking check box.
You can syntax check the whole source member currently in the LPEX Editor view by
clicking Source > Syntax Check All on the workbench menu.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-93
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
After a moment the verifier will display an iSeries Error List view below the Editor
view.
2-94 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Fixing errors
Next you will fix the errors in your source.
To fix an error in your source go to the iSeries Error List view:
__ 1. Double-click the first error with an ID of RNF7030.
You are automatically brought back into the Editor window to the line where the error
occurred. The error on line 365 is a typo. The variable EMES should be EMESS.
One good way of finding the correct name is to use content assist.
Note
Note: The Outline view must be active and populated to use content assist.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-95
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. Double-click the variable EMESS in the list to correct the variable name.
Another way to find the variable name is to use the Outline view and see what
variables are declared.
The next error in the iSeries Error List view is a RNF7030 as well.
__ 4. Double-click the second RNF7030 entry. RSNTAX should really be RSNTAG.
Make the appropriate change.
2-96 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Note
The next error is actually RNF7018 but it is related to the one you just fixed and can be
ignored. It shows the same line number, which is an indication that both errors are related.
__ 6. Double-click RNF5184.
__ 7. Fix the error with Factor 2 by replacing the 2 with a 1.
Note
Error RNF7515 is related to the first error you fixed. It has the same line number. You can
ignore it.
The only serious remaining error is RFN5178. This error is caused by a missing
ENDSR.
Note: The verifier could not determine where the ENDSR is missing so the line
number reported is 1. For this reason, you can't just double-click on the error
message. You need to investigate where the missing statement belongs.
Hint
You can use Source > Show Indentation or right-click and Filter View > Subroutines to
determine where the ENDSR is missing.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-97
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 9. Remove the asterisk (*) from the C-spec, which was making this source line an
erroneous comment line..
Hint
You can use the Tab key to quickly move to the appropriate column.
2-98 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty You can filter out messages according to these severities by using the filter menu.
__ 10. Click the arrow in the upper right corner of the iSeries Error List title bar.
__ 11. Click Show Severity on the pop-up menu.
__ 12. Clear the severities you don't want to see in the list by clicking on the menu entry
(Information and Warning and Error, in this case, leaving only Severe and
Terminating errors). Perform this multiple times to clear multiple severity types. After
clearing Error, you will see all non-Severe and non-Terminating messages disappear
from the iSeries Error List view.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-99
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
• Press Ctrl+S.
Changes are uploaded to the i5/OS.
__ 2. Use Source > Remove Messages to clear the verify messages from your source
view, so that you can re-run verify and not have previous verify messages
remaining.
__ 3. Verify your source again via Source > Verify.
You should not see any Severe or Terminating messages. You are ready to compile
the program.
You have verified your source and fixed any errors.
2-100 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-101
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 5. In the right pane of the Preferences window, clear the Compile in batch check box.
2-102 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-103
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-104 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty The progress bar on the workbench (in the bottom status area) will indicate that the
compile is running. The iSeries Error List will be shown with no errors – if you still
have the message severity filter in effect. If you specify to see Error severity level
and below, you will see the following messages.
If you are not sure that the compile was successful, you can check the iSeries
Commands Log.
__ 5. Click the iSeries Commands Log tab at the bottom of the workbench.
This log shows a list of all commands run on the remote system and the messages
returned for each command.
You have set compile preferences, invoked the compile command, and checked for a
successful compile.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-105
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. Click Prompt.
2-106 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 4. The Change Library (CHGLIB) prompt window will now appear. Enter RSEWDSC
for the Library field and type over *SAME with WDSC RSE Classroom Library in
the Text ‘description’ field.
__ 5. Press OK.
The command will run on i5/OS and after completion you will see the completion
message on the bottom of the iSeries Table View.
You can also connect to systems other than i5/OS with the Remote System Explorer
and launch commands for these systems as well, for example, your local system, or
Linux.
You have submitted a command to change a library text description in the command line of
the iSeries Table View.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-107
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-108 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Hint
Use the Start or Configure Session function of PCOMM or Pc5250 to define a connection
to <i5/OS_system>. Your classroom instructor may already have a shortcut to PCOMM or
Pc5250 on your Windows desktop for you.
Note: Instead of the Enter key, you may have to use the Ctrl key in your
5250-emulation session.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-109
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. In the command line, type the following command (refer to your lab information
sheet for the connection name to use):
STRRSESVR <i5/OS_system>
__ 4. Press Enter.
The value of the STRRSESVR parameter (<i5/OS_system> from your lab
worksheet) is the name of the connection you defined in the Remote Systems view.
This associates the interactive job with the Remote System Explorer
communications server.
2-110 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty Now the interactive 5250 job will connect to WDSC on the client PC, and go into a
wait state, waiting for you to run a program from your WDSC workbench.
Note
Notice that a command to add your team library was run in the STRRSESVR interactive
job. This came from the initial library list specification you defined in an earlier lab for your
WDSC connection.
Hint
Find your team library <team_lib> in your Library list filter. You may need to refresh the
view in your library or filter within the Remote Systems View.
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-111
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. Find your 5250-emulation window on your Windows desktop and bring it to the
foreground by clicking on its title bar.
You will see a Time Reporting System payroll menu.
__ 5. Type X beside the Employee Master Maintenance menu item.
2-112 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
End of exercise
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-113
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2.4. Quiz
Now you are ready to review your knowledge of this module by taking the quiz. You can
also apply what you have learned in this module by completing the practice tasks detailed
in “More practice” on page 2-116.
__ 1. You can configure the LPEX Editor to adopt the keyboard and command
personalities of many popular editors. (T, F)
__ 2. To receive language sensitive help, press the ____ key in an Editor window. Name
the key:
a. F2
b. F3
c. F1
d. F4
__ 3. You can search for:
a. A word
b. A partial word
c. A sequence of words
d. A pattern if it follows the rules of regular expression
e. All of the above
__ 4. The LPEX Editor allows you to ____ or subset your source so that you see only lines
containing a given string.
a. search
b. find
c. sort
d. filter
__ 5. Syntax checking can be done either when the cursor leaves each line of source or
all at once on either the currently selected source or on the entire source member.
(T, F)
__ 6. The ______ tool checks for semantic (compile) errors on your workstation so that
you can guarantee a clean compile on i5/OS.
a. Compile
b. LPEX Editor
c. Program Generator
d. Program Verifier
2-114 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 7. If you used the local program verifier, then your host compiles should be successful;
no wasted i5/OS cycles. (T, F)
__ 8. A compile command can be run on an i5/OS server from the Remote System
Explorer, and you can retrieve error feedback from the compile. (T, F)
__ 9. Interactive programs require a 5250 emulator, and you need to first run a Start RSE
Server (STRRSESVR) command to associate the emulator with a particular
connection in the Remote System Explorer. (T, F)
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-115
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-116 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 2. Editing and compiling source code 2-117
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
2-118 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Introduction
Using an editor to create and maintain DDS source for your display
files can be a frustrating and difficult task. What would be great is a
graphical design tool that lets you design your screens visually and
then generate the DDS source for you. Well, that's exactly what
Screen Designer does for you.
Screen Designer helps the novice DDS programmer create screens
quickly and easily without worrying about the details of the DDS
language, while at the same time letting the expert DDS programmer
get access to all the features and power of the language.
3-2 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
3-4 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty To show file-level keywords and the record SELECT in the DDS tree:
__ 1. In the Outline view, expand the MSTDSP.DSPF folder.
__ 2. Expand the file-level keywords in the first folder under MSTDSP.DSPF, beginning
with DSPSIZ...
__ 3. Expand the SELECT record.
__ 4. Expand the EMESS field, and click to select the EMESS folder.
The Outline view DDS tree now shows you a summary of the file-level keywords and
of the record SELECT.
You have seen the file-level keywords and the record SELECT in the DDS tree.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
In the main Screen Designer view, note how the SELECT record is highlighted in the
Controls section, and in the green screen design view, the EMESS field on Line 21 is
highlighted.
3-6 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty
Information
Experiment with the magnification and grid sliders and how they affect the 5250
green-screen window appearance.
The default magnification is 100%. The 100% button will take the magnification back to this
default if you want to return after using the slider to increase or decrease the view of the
green-screen window. Next to the 100% button is a two-sided arrow button that will
automatically scale the green-screen window to the current width of the Screen Designer
view in the workbench, so that the entire width of the green-screen application can be
seen.
The Grid slider adjusts the visible intensity of the row-column grid on the green-screen
application display so that you can line up rows and columns easier with your display fields.
The default grid intensity is 20%.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
3-8 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 2. In the Outline view, expand the SELECT record-level keyword folder.
__ 3. Expand the BLINK ALARM folder.
__ 4. Expand the ALARM keyword folder, and then click on Condition 60.
The Properties view shows the indicators set for the ALARM keyword (indicator 60
is the only only condition set). This interface can be used to AND, OR, and NOT
indicators.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 5. Now, you will look at the DDS source line and properties for a selected object, you
are working with. In the Outline view for the SELECT record, click to select, and
then expand the EMESS field folder and subfolders..
3-10 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 6. Double-click on the Properties tab to maximize the view or drag the Properties tab to
the bottom middle view area in your workspace, or simply re-size the view to see
more details on the EMESS field.
__ 7. Click on the Attributes tab to see the high-intensity setting for this field, that is
conditioned by Indicator 60.
Note
Any changes made within this Properties panel is automatically reflected in the
green-screen design preview and in the DDS Source
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 8. In the main Screen Designer view, switch from the Design tab to the Source tab to
view the DDS source member. You may need to click on the Properties view tab to
restore it from maximized to normal size. The source is automatically positioned to
the EMESS field definition, because EMESS is the selected object in the Outline
view.
.
Even this relatively small and simple DDS source member demonstrates how much
easier it is to use the Screen Designer to navigate through your DDS source. The
syntax is being interpreted in intuitive graphical ways making it an ideal tool for
learning DDS. But to get orders of magnitude improvement in your productivity what
you really need is to work with your screens and reports in a WYSIWYG fashion,
completely independent of the DDS required to make things appear the way they
do. You need the Design Page.
You have seen the details of the record SELECT, the record-level keywords and the
field-level keywords.
3-12 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
In order to understand where MAIN_MENU1 came from, you need to understand the
concept of a screens group. A screens group is simply a collection of one or more DDS
records that represent how a screen would be assembled at runtime. It allows you at
development time to work with screens as they would appear when they get assembled by
your programs at runtime. To work with screen groups in Screen Designer you need to tell
Screen Designer which record formats make up a screen. In this case this has been done
for the screen you see in the Design page. A group MAIN_MENU1 has been pre-created
for you by your instructor and Screen Designer has saved this information in the DDS
source in comment lines. Any screen groups that you create are persisted as comment
lines in the DDS so you can re-use these groups in subsequent Screen Designer sessions.
Any groups you create will appear in the Screens list in the Controls section of the main
Screen Designer view to allow quick access to each group of records.
You have seen the concept of a group, specifically the MAIN_MENU1 group.
3-14 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 2. Type over the default screen name of Untitled1, changing it to SCREEN1.
You have finished creating a group. You could now work in the Design page with the
record formats contained in this group. Instead you'll create a new record format.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
It appears that this is one of those unusable applications where you have to know
the employee number ahead of time instead of being able to browse what is in the
database. What we really need is a subfile. Subfiles are not difficult to create with
Screen Designer.
You have inserted a new screen group using the existing record EMPSEL.
__ 3. You can create things on the Design page by selecting the appropriate tool from the
Palette on the right-hand side and then click on the Design page where you want it
3-16 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty to be created. Right now, most tool buttons are absent from the palette because
there is no record in which to create fields. The only two Records buttons available
are Standard Record and Subfile Record. If you leave the mouse over a button for
a second or two, fly-over help will appear describing the indicated button.
__ 4. Click the Subfile Record button and then click anywhere within the blank gray
design area.
The design area is still empty, but it turns black, and a subfile and a subfile control
record pair are created. You can see this via the Records tab, with SFL1 and CTL1
created for you..
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Additionally, you can see the newly created subfile and subfile control record pair in the
DDS outline and Properties views.
3-18 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 2. Click the Named field button (shown below) and then click somewhere on row 8.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Six fields appear in a vertical column. This is because the subfile you created,
currently specified a SFLPAG (visible list size) of six, by default.
The Outline view confirms the size of the displayable subfile and the field placement
and length. You will move the field position in a later step, so it is OK if your field
position does not match the screenshot below.
3-20 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty The Properties view for Field1 shows the type of field, position, and length in an
editable details box. Changes in the Properties view will be automatically reflected in
the Design page and in the DDS source.
__ 3. In the Design page, click the top row in the six-row subfile, and hold the mouse
button down and drag it to Row 8, Column 5, releasing the mouse when the
hoverhelp indicator shows that the leftmost position of the field is on Row 8, Column
5.
All the rows in the subfile will move to the position on the Design page that you drag
the mouse to..
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. Move the cursor over to the right edge of the field. It turns into a double-headed
arrow. Hold down the mouse button and move it to the left. The size of the field will
be reduced. The current size will appear just above the field. When the size is 3, let
go of the mouse button.
The Design area will now reflect a subfile with field length of 3, instead of 9.
3-22 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 5. Rename the field from FIELD1 to OPCODE by typing over the field name in the
Properties view, and pressing Enter. The Outline view will be automatically updated
with the change from FIELD1 to OPCODE, as will the DDS source.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. In the Properties view for the OPCODE field, click the Color tab, select the Pink
button, and press the Add button to change the color from green to pink.
__ 7. Click the Basics tab in the Properties view for the OPCODE field, and change
Usage from Both to Input.
You will see the Design view reflect the new pink color, and the subfile record will be
filled with ‘I’ characters to represent Input, instead of the ‘B’ characters that
previously represented a usage of Both.
__ 8. Save your changes thus far via CTRL-s or clicking the Save toolbar button.
Now you will create an additional column in the subfile.
3-24 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 2. Drag the right edge of the new field out until the field has length 30.
Notice on the Outline view that you have created a new field, FIELD1, of length 30.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. In the Properties view for FIELD1, click on the Basics tab, and rename the field
name to ENAME and change the Usage from Both to Output. ENAME will contain
the employee name.
3-26 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 4. In the Design page Palette, click the Named Field button, and then move the cursor
to row 8, column 41 in the Design page, and click. You will see hover help in the
Design page, which will assist you in locating the row and column for placement of
your new field.
Notice on the Outline view that you have created a new field, FIELD1, of length 9.
__ 5. In the Properties view for FIELD1, click on the Basics tab, and rename the field
name to SALARY, change the Usage from Both to Output, change Type from
Character to Zoned, and then change Shift to Y - Numeric only. On this same view,
now set the Length of the SALARY field to 8, and set Decimals to 2.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. Now you will apply an Edit Code (EDTCDE) to the Salary field. In the Outline view,
click on the SALARY field under the SFL1 folder. In the main Screen Designer view,
click the Source tab. You should automatically be positioned to the DDS source line
with the SALARY field definition.
__ 7. Press the F4 function key to open an iSeries Source Prompter view for this DDS
source line. In the Functions field, type in EDTCDE(1 $) . Then press the Apply
button to enter your source file change.
Note
3-28 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty
Important
The EDTCDE support in the DDS is correct. When called by your RPG or COBOL
program, it will format this output field in a format $666,666.66 using a currency symbol,
comma separators, and two decimal points. However, the Screen Designer Design page,
and Editing tab in Properties do not visualize Edit Codes properly. This is why you see
-66666666 with two trailing blanks in the Design page with WDSC 7.0. This should be
corrected in the next release of WDSC, and only affects viewing within Screen Designer.
__ 10. In the Properties view for the SALARY field, click the Color tab, select Yellow for the
color, and click the Add button.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 11. The subfile seems compacted to the left. Please go into the Properties view for each
field and set the position column to:
• SALARY - Column 62
• ENAME - Column 22
• OPCODE - Column 10
This will space the fields out on the green-screen display a little nicer..
3-30 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 12. You will now change the maximum number of entries in the subfile that can be filled
in by the RPG or COBOL application. You will also specify how many of these
entries appear on the green-screen at one time before the end-user needs to scroll
the subfile.
In the Outline view, click the subfile control record CTL1. Then in the Properties
view, click the Subfile Control tab.
Set the Number of entries (SFLSIZ) to 100.
Set the Entries per displayed page (SFLPAG) to 9.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 14. In the main Screen Designer view, make sure record SFL1 of screen EMPL_LIST is
selected for viewing via the Controls section. Now you can see that the subfile is
displaying 9 records at a time, before the end-user needs to press the scroll key to
see more.
You have added some rows to the new subfile record screen.
3-32 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty You will now see the subfile fields from record SFL1 superimposed in a
semi-transparent fashion on the Design page for subfile control record CTL1.
Hint
You can click the Display bright text button to make the semi-transparent fields easier to
see. This button is just to the left of the Draw records transparent button.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-33
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. Now you will provide a 'Position to' entry in the subfile control header. From the
Palette in the Constants section, click on the Text Constant button and click again
in the Design page at Row 4, Column 9.
__ 4. Select the new constant field in the Design page, and type Position to: over the
default of “Text Constant”.
3-34 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty You could create a named field with the right characteristics like you did in the
subfile, or use the Reference tab in the Properties view for the field to establish a
database or source reference. You will use a source reference to create this
employee name field from a definition in another record format within your source
member MSTDSP.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-35
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. In the Outline view, expand record EMPMNT and click on the ENAME field to select
it. This field is defined by reference to a database file field. When you click on it,
WDSC resolves the reference. Notice how length 30 is derived after you click on the
field.
__ 3. In the Outline view, expand subfile control record CTL1, and click on the new field
you added with the Named Field button, FIELD1.
__ 4. In the Properties view for FIELD1, click the Reference tab, and then select the
Source reference button.
3-36 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 5. You will define this field to reference a field you already have in your DDS for
employee name, so that you can make maintenance easier by changing a field
definition in one spot, and have that change reflected by reference elsewhere in
your DDS. Click the EMPMNT record, and then the ENAME field. Notice how the
reference field length of 30 and type of Character is derived for you.
__ 6. In the Design page, notice how the new field is now 30 characters long.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-37
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 7. Now you will take a look at the generated DDS source to see the reference
information. In the Design page, click on the Source tab, and you should be
automatically positioned at the active DDS object, FIELD1, at the bottom of the
source member.
__ 8. Press F4 to bring up the iSeries Source Prompter view. Notice in the Functions field
the reference to record format EMPMNT and field ENAME within your DDS source
member.
__ 9. Now, via the iSeries Source Prompter view, change the field name from FIELD1 to
POS_TO and press the Apply button. You will notice the Outline view change from
FIELD1 to POS_TO automatically.
3-38 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 3. Now the Indicators... button will appear. Click that button.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-39
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 5. Now use the Attributes tab to set Reverse image and Position cursor, with
indicator 60 as the condition.
__ 6. Examine the DDS generated in the Source tab of the main Screen Designer view...
Notice that all the new keywords were created with a condition of 60.
You have added error handling to the position to employee name field.
3-40 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 2. Change the year from 2 to 4 digits. Select the Length of year check box and select
4 digits from the list.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-41
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
This page shows you the subset of keywords that are allowed for the selected file,
record or field and it takes into account the field's type, usage, shift and what record
it is in. It is very powerful to know exactly what your options are. This information
cannot be quickly ascertained from the Reference manual.
__ 3. In the Keywords tab, double-click the INDTXT keyword.
The keyword is created in your Outline viewfor the EMPAPL field.
__ 4. Double-click the INDTXT keyword again.
__ 5. Use the Source tab in the main Screen Designer view to see your DDS Source.
3-42 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 6. The INDTXT keyword requires two parameters. It is allowed to have multiple
INDTXT keywords with different parameters, however, you cannot have multiple
INDTXT keywords that have the same parameters; this is considered a semantic
error. In the source, add the following in the Functions field after INDTXT:
(02 ‘Hi’)
The DDS source is checked using the same verifier that the LPEX Editor uses. A
message appears on the status line at the bottom of the Designer stating that the
“Verify program action completed with errors”.
__ 2. If there are problems, they will show up in the iSeries Error List view. Click the
iSeries Error List tab. Make sure Warning level messages are showing via the
Show Severity filter.
__ 3. Double-click the warning DDS7861 in the Error list.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-43
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
In the DDS Source view, the cursor is placed exactly where the error is in the
source. .
__ 4. Delete the source line in the EMPAPL field definition with the second INDTXT
keyword (should be line 32).
Note
You will see a red ‘X’ appear next to DDS7861 now in the iSeries Error List view, as an
indicator that the error situation has been corrected.
Part 13: Compiling your source changes and closing the Screen
Designer
Now you will compile the source on i5/OS just as you did in the Remote Systems LPEX
Editor and then close the Designer.
To compile your source:
__ 1. From the main WDSC workbench menu, click Compile(G) and then Compile, and
then CRTDSPF.
__ 2. Status messages will appear at the bottom of the WDSC workbench. The iSeries
Error List view will appear with no messages.
3-44 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 3. The iSeries Commands Log view will show the messages from the compile
command you issued to i5/OS.
__ 4. To close the Screen Designer, click the X on the Technical Preview: MSTDSP.DSPF
tab.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-45
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. Right-click MSTPRT and select Open with > CODE Designer in the pop-up menu.
__ 3. After the file loads in CODE Designer, click the REPORT1 tab in the workspace.
You should now see the printer file loaded in the Design view.
3-46 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 4. Now, you will add a time field to the report. Click on the design window two spaces
after the MM/DD/YYYY field on Row 1, Column 12. (You can use the left arrow and
the right arrow to move the cursor.)
__ 5. In the palette on the left side of the design pane, click the Create time field button.
(Hold your mouse pointer over a button for a few moments to see the fly-over help
text.)
__ 6. Now, click the blinking cursor in the design pane to add the field.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-47
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Notice that the field has the default format hh.mm.ss (hours.minutes.seconds). Next
you will change the field to use a colon (:) as a separator.
__ 7. Right-click the hh.mm.ss field you just added and select Properties. (Alternatively,
you can press F4.)
3-48 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 8. In the Field properties notebook, select the Format checkbox and select *HMS from
the list.
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-49
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
At the bottom of the window, you should see a message stating that the verify
completed with no errors.
__ 14. Click Tools > Compile from the Designer menu and then click No prompt (or click
the Compile Source button on the CODE Designer toolbar).
__ 15. A message indicates when the compile is complete. Click OK in the Message
dialog.
__ 16. To close the Designer, click File > Exit from the Designer menu.
End of exercise
3-50 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 3. Creating a screen with Screen Designer 3-51
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
3-52 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Introduction
The Integrated iSeries Debugger is a source-level debugger that
enables you to debug and test an application that is running on i5/OS.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
4-2 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Important
The Application Diagram function is only available in the Advanced Edition of WDSC.
Before you start debugging programs, let’s take a look at the Application Diagram function.
The Application Diagram function provides a graphical view of the different resources in an
i5/OS native application and their relationships to each other. There are two different
diagrams that you can look at in the Application Diagram view:
• Source Call Diagram
• Program Structure Diagram
The Source Call Diagram takes ILE COBOL source as input and displays a call graph
showing subroutine and procedure calls.
The Program Structure Diagram takes program and service program objects as input and
displays the binding relationships between them as well as the modules bound into each
program and service program.
To launch the Application Diagram function:
__ 1. In the Remote Systems view expand the Library list filter, if it isn't expanded
already.
__ 2. Expand library <team_lib>, if it isn't expanded already.
__ 3. Open the PAYROLLD.cblle source member in the QCBLLESRC source file via the
LPEX editor.
Hint
Double-click the source member within RSE to open it in the LPEX Editor view.
4-4 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Hint
You can also use the Application Diagram icon on the main workbench toolbar to launch
the Application Diagram function.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Notice that the box around 0400-PRJMST-SELECT is now highlighted and all
relationship arrows are highlighted. Arrows pointing away from the
0400-PRJMST-SELECT subroutine point to subroutines that
0400-PRJMST-SELECT calls. Arrows pointing to subroutine
0400-PRJMST-SELECT indicate calls to 0400-PRJMST-SELECT.
4-6 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
The Properties view opens, and displays information about the currently selected
subroutine 0400-PRJMST-SELECT.
__ 7. Select the Calls tab to view a list of the respective subroutines which
0400-PRJMST-SELECT calls and the source lines where the called subroutines
begin and end.
The list of subroutines can be used to quickly jump to the specified line in the
source. Likewise the Called by tab shows the list of subroutines which call
0400-PRJMST-SELECT.
__ 8. Within the Calls tab list, double-click the 0450-EXIT subroutine line.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
This takes you directly into the PAYROLLD source to the start of subroutine
0450-EXIT.
4-8 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 10. You can save the application diagram as a text or image file. Right-click in a blank
open area within the Application Diagram view and select File -> Save As Image
File..
__ 11. The Save As Image File dialog will appear. Press the Browse button, select the
Desktop for the Destination Folder, press OK.
__ 12. Back on the Save As Image File dialog, enter AppDiagramPAYROLLD.gif for the
File Name: field, and press OK.
Optional: Locate this .gif file on your Windows desktop and double-click it, to view
the application diagram that you saved.
__ 13. Experiment a little bit with the Palette on the right-hand side of the Application
Diagram view.
Click on the Zoom button in the Palette to obtain a zoom tool; clicking within the
Application Diagram view will zoom the view to focus in more on the area that you
click with the zoom tool. Right-click within a blank open area of the Application
Diagram view to see more zoom options.
Click on the Note button in the Palette to obtain a note tool; clicking with the
Application Diagram view will let you create a note with text of your choice, to help
you annotate the application diagram with your comments.
__ 14. Close the Application Diagram PAYROLLD tab. If prompted to save changes, select
No.
__ 15. Close the PAYROLLD.CBLLE source member tab. If prompted to save changes,
select No.
You have spent some time familiarizing yourself with the Application Diagram
function, which allows a graphical view of a program’s call structure.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. In the Remote Systems view expand the Library list filter, if it isn't expanded
already.
__ 3. Expand library <team_lib>, if it isn't expanded already.
4-10 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
When a service entry point is created, a process for tracking service entries is
started on i5/OS (one process per i5/OS/userid combination). The i5/OS process
ends automatically when the WDSC workspace is closed, if the RSE connection is
disconnected, or if the user removes the service entry point.
__ 6. A message displays indicating the service entry point was successfully set. Press
OK.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Note
There is a possibility that you will get an error stating that you need to start the Debug
Server on i5/OS. Your instructor should have done STRSRVJOB on the i5/OS system for
you already, but in case you see this in your own work environment, here is how to correct
it:
The iSeries Service Entry Points view is automatically added to your workspace. It
lists all the defined service entry points. You can use this view to remove, enable,
disable, modify and refresh service entry points.
The default is to create a service entry point that will stop on entry into any module
(*ALL) or procedure (*ALL) within a program. The service entry point can be
modified after creation to stop at a particular procedure name or module name
within the program. Also, the program will only stop if the specified user ID is running
the program on i5/OS. The user ID can be changed via the modify operation.
4-12 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Hint
Use the Start or Configure Session function of PCOMM or Pc5250 to define a connection
to <i5/OS_system>. Your classroom instructor may already have a shortcut to PCOMM or
Pc5250 on your Windows desktop for you. If you already have a 5250 session active, you
can use that session instead of starting and signing on to a new one.
If you have an existing 5250 session that is still associated to the RSE server job via
STRRSESVR, you need to release the interactive session. To do so, in the Remote
Systems view, right-click iSeries Objects and click Release Interactive Job on the pop-up
menu.
Note
Instead of the Enter key, you may have to use the Ctrl key in your 5250-emulation session.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 9. On the command line of the 5250 screen, enter ADDLIBLE <team_lib> where
<team_lib> is your team library from the lab information sheet. This will add your
team library to your interactive 5250 session’s library list.
__ 10. On the 5250 screen, enter CALL PGM(<team_lib>/CLC1) PARM(‘xx’) where ‘xx is
your team number. This will invoke your application program.
Note
For example, if your Team Number is 02, then type ‘02’ here. Do not forget the single
quotes around your Team Number. Make sure the PARM(‘02’) in the formed command
string looks OK before pressing Enter. If the PARM parameter is omitted, you will receive
an error when the CL program tries to call the payroll program.
As soon as the program enters the system, the service entry point is hit and a debug
session is started in WDSC and the Debug perspective appears with CLC1’s source
code in the editor. Your program is stopped at the first executable statement.
4-14 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 11. Click anywhere in the WDSC workbench to give the WDSC overall window
foreground focus.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
A dot with a checkmark in the prefix area indicates that a breakpoint has been set for
that line. The prefix area is the small grey margin to the left of the source lines
sequence numbers.
Now you will add a conditional breakpoint to stop in the loop when it loops the 99th
time.
4-16 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 1. Position the cursor on line 8 and make sure that line is selected.
__ 2. Right-click on line 8.
__ 3. Click Add breakpoint on the pop-up menu.
__ 4. Click the Breakpoints tab in the upper right pane of the Debug perspective.
The Breakpoints view is displayed.
__ 5. In the Breakpoints view right-click the breakpoint for line 8.
__ 6. Click Edit Breakpoint on the pop-up menu.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 7. Click Next.
__ 8. You only want to stop in the loop when it executes for the 99th time or more. You can
do that by setting the From field of the Frequency group to 99. Click Finish.
4-18 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty You have added a breakpoint including a conditional breakpoint to your source.
The variable appears in the Monitors view. Its current value is zero.
Now that some breakpoints are set, you can start to run the application.
__ 4. Click the Resume icon from the Debug toolbar.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
The program starts running and stops at the breakpoint at line 8. (The Debugger has
to stop 98 times but because of the condition you set, it continues to run until the
99th time.) Notice in the Monitors view, that &count now has the value 99.
__ 5. Click the Resume icon again.
The program stops at the breakpoint at line 8 again and &count now has the value
100.
__ 6. Click the Resume icon once more so that the program runs to the breakpoint at line
11.
You have monitored the variable &count.
The source of PAYROLLD is displayed. Depending on the Debug view option you
used to compile the program (*SOURCE, *LIST, or *ALL for ILE COBOL), this
window displays either the Source or Listing View. If Debug view *ALL was used,
you can switch back and forth from Source to Listing via right-clicking in the source
and selecting Switch View.
Your instructor has compiled PAYROLLD for you already with the *SOURCE Debug
view option.
You have stepped into PAYROLLD program.
4-20 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
The stack entry allows you to work with and switch between different programs
and/or ILE modules.
You have viewed the call stack entries of your program.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
This view shows all breakpoints currently set in your Debug session. This is a
convenient place to work with breakpoints. You can remove, disable and enable,
add, or edit a breakpoint. These tasks are available from the pop-up menu when you
right-click in the view area. Double-click any entry to show the source where the
breakpoint is set.
You have added several breakpoints to PAYROLLD.
4-22 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
The icon is removed from the prefix area indicating that no breakpoint is set on that
line. The breakpoint is also removed from the list in the Breakpoints view.
Note
You could also select and right-click anywhere in the source area of Line 206 (to the right of
sequence numbers) and select Remove Breakpoint from that context menu, to accomplish
the same thing.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
The program waits for input from the 5250-emulation session. Switch to your 5250
emulator session.
4-24 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 8. Press Enter.
The variable is successfully changed. Notice how the icon for RSNAPL in the
Monitors view has changed to indicate the variable has been altered via debug.
You have monitored several variables in PAYROLLD.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
This will open the Memory view in the notebook at the bottom of the workbench
perspective. The tab within the view shows the name of the variable (IND-ERROR).
__ 3. Use the scroll bar on the right of the Memory view to scroll down.
You can see the current contents of the memory.
__ 4. Right-click in the view area within the memory contents table.
4-26 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 5. Click Reset to Base Address on the pop-up menu to return to the starting address.
__ 6. To get the hex content of the memory starting with the selected variable
IND-ERROR, right click on this variable in the source view again, and this time,
select Monitor Memory > 2 Hex . A new page with the hex values is added to the
Memory view. You will now have an EBCDIC and Hex memory sub-view for the
same IND-ERROR variable.
__ 7. Since you are only monitoring one variable’s memory storage, click the Toggle
Memory Monitors Pane button on the right-hand side of the Memory view to simplify
the information displayed by temporarily removing the Monitors column.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 8. Click on the EBCDIC sub-tab, and then click on the grey X to remove the memory
monitor rendering for EBCDIC, leaving just the Hex rendering.
__ 9. Click the Toggle Split Pane icon, select EBCDIC for a rendering and click the Add
Rendering(s) button. This will give you a Hex memory rendering and EBCDIC
rendering side-by-side within the same view.
__ 10. Use the Link Memory Rendering Panes icon to control the scrolling of the memory
renderings side-by-side views. You can have the renderings scroll independently of
each other, or in synchronization with each other. Explore the scroll bar action with
the Link Memory Rendering Panes icon depressed and reset.
__ 11. Click the Toggle Memory Monitors Pane icon to re-display the monitored variable
column.
__ 12. Click each gray X (Remove Rendering) button for the Hex and EBCDIC renderings,
to remove them both.
4-28 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 13. Click the XX (Remove All) icon to remove all variable memory monitors. When
prompted with the Remove All Memory Monitors message box, click the Yes button.
__ 14. Click the X on the Memory view tab, to close the Memory view.
You have added a memory monitor, and experimented with renderings for the variable
IND-ERROR.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 1. Go to the Line number field at the bottom of the source area. In this field enter 118
and press Enter to go to that line.
4-30 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty The Add a Watch Breakpoint window opens. The Expression field is pre-filled with
the highlighted variable IND-TABLE.
By default the Number of bytes to watch field is set to zero, which means the
variable will be watched in its defined length.
__ 4. Click Finish.
The watch breakpoint is now set.
__ 5. Click the Resume button on the Debug toolbar.
The application waits for input from the 5250-emulation session.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. In the 5250 emulation session, type 123 for Project Code and D (for delete) in the
Action Code field.
__ 7. Press Enter. A message is displayed indicating that the variable IND-TABLE has
changed.
__ 8. Click OK.
4-32 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 9. In the Breakpoints view, right-click the Watch breakpoint and click Disable on the
pop-up menu. This will uncheck the breakpoint selection box.
You have added a watch breakpoint for the variable IND-TABLE and run the program to
see the notification that the variable has changed.
Important
You may need to click the Resume icon again, if the 5250 application did not end. This will
depend on whether the project code has already been deleted indicator was turned on or
not.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-33
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Click OK.
__ 5. Close both the CLC1.CLLE and PAYROLLD.CBLLE LPEX editor sessions by
clicking the X on their tabs.
__ 6. Right-click the Debug perspective icon at the top right of the workbench. Click
Close on the pop-up menu to close the Debug perspective and return to the Remote
System Explorer perspective.
Part 13: Starting the Integrated Debugger using the Debug action
You will still be working with the COBOL program PAYROLLD.
Besides using service entry points to start a debug session, you can start the Debugger
directly from the pop-up menu of a program or service program in the Remote Systems
view, or from a Launch Configurations window. Starting directly from the Remote Systems
view does not allow you to specify parameters to be passed to the program. The Launch
Configurations window allows you to modify how the program is invoked and to specify
parameters.
CL program CLC1 requires a parameter.
To start the debugger:
__ 1. In the Remote Systems view expand the Library list filter, if it isn't expanded
already.
__ 2. Expand library <team_lib>, if it isn't expanded already.
__ 3. Right-click program CLC1 in library <team_lib>.
4-34 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 4. On the resulting context menu, select Debug(Service Entry) > Remove Service
Entry Point. This will remove the service entry point we set earlier - in this lab
section we are explicitly going to start the CLC1 program after running STRRSESVR
to tie the 5250 emulation session with WDSC’s debugger.
__ 5. Right-click on program CLC1 again, and select Debug (Prompt)(J) > Interactive...
from the pop-up menu.
__ 6. On the My iSeries program (Interactive) Modify attributes and launch panel, clear
the contents of the Name: field, and type CLC1 . This gives your debug
configuration a unique name so you can use it again when you debug this program.
__ 7. Click the How To Start tab.
By default, the page contains a call for the program and library for the object from
which RSE launched the debug wizard.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-35
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 8. Click Prompt.
4-36 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Note
For example, if your Team Number is 02, then type ‘02’ here. Do not forget the single
quotes around your Team Number. Make sure the PARM(‘02’) in the formed command
string looks OK before pressing OK. If the PARM parameter is omitted or is an incorrect
format, you will receive an error when the CL program tries to call the payroll program.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-37
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
The interactive connection is not currently active. Go to your 5250 emulation session
and start the interactive connection following the instructions in this message box.
You do not have to cancel the message box. It will be removed as soon as the
connection between the Remote System Explorer communications server and the
interactive session has been established. Now the Debug perspective will be loaded
into the workbench.
Hint
Copy the CL command text from step 2 in the message box into the 5250 emulation
session’s command line, to save some time.
Now that the program is active on the i5/OS server and stopped at the first
executable statement, the debugger displays the source.
4-38 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-39
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 14. To get control back to the Debug session, click the Suspend icon.
You can now set breakpoints and use all the Debug features. You will also see the
source for PAYROLLD loaded into the Debug perspective.
Hint
Hint
You can also edit, delete and create debug configurations by clicking on Run on the
workbench main menu bar, and select Debug...
4-40 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty
Here you can see the CLC1 debug configuration. This is your saved configuration to
debug CLC1 as an interactive application. You could now modify this configuration
to use a different parameter, copy this configuration, or create a new one. Notice the
list of debug configurations you can choose from.
__ 18. Press Close. The intent here is just to view the way to see previously saved
configurations.
__ 19. Close all source member editor views (CLC1 and PAYROLLD).
__ 20. Close the Debug perspective to return to the Remote System Explorer perspective.
__ 21. Right-click on the iSeries Objects subsystem in the Remote Systems view, and
select Release Interactive Job to end the STRRSESVR linkage to the RSE server.
You have started the debugger using a debug action and viewed a saved debug
configuration.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-41
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
4-42 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-43
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Note
Be sure to enter a blank space before the PARM parameter in the command string. Also,
you could press F4 in the Command to run: field to be prompted to add the parameter.
__ 5. Press OK to return to the Modify attributes and launch panel. You will now see your
parameter in the SBMJOB command string.
4-44 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
__ 11. Find your batch job in WDSC by expanding the iSeries Jobs subsystem, and then
right-click on My active jobs and select Refresh. Then expand My active jobs
folder, and then expand QBATCH.
__ 12. Your job will have <i5/OS_userid> for the job name and job user. Select and
right-click on this job, and select Debug As > iSeries Job
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-45
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
The Debug perspective will now open, and CLC1 source member will be loaded into
the view.
__ 13. In the Debug view, you can see that Thread:1 is stopped, and the active procedure
is a Function Check Exception Handler. Click on the CLC1 : CLC1 : CLC1
procedure under the Function Check Exception Handler line, and you will see the
CLC1 source view positioned to the instruction that caused the function check.
Note
Note that the source line with the failure is 1100 and the instruction is a CALL command.
This matches the information you saw on the Inquiry Message panel on the 5250 emulation
window.
You will need to look at the value of the &lib variable.
4-46 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 14. Double-click on &lib on line 1100 and then right-click and select Monitor
Expression.
__ 15. Click on the Monitors view tab, and you will see that &LIB is set to a library name
ending in 78. We do not have team numbers as high as 78, so this is not a valid
library name. You could confirm that using WRKLIB on 5250 or via a WDSC library
filter.
Now that you know what the problem is, you will terminate the debug session and
cancel the batch job.
__ 16. Click the Terminate icon on the Debug view toolbar.
__ 17. Close the CLC1 editor view, and then close the Debug perspective to return to the
Remote System Explorer perspective.
Your debug session is cancelled, but your job is still in Message Wait status on the
i5/OS server.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-47
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 18. Back on your 5250 emulation window, respond C on the Inquiry Message window to
cancel your batch job, and press Enter.
End of exercise
4-48 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Important
The Application Diagram function is only available in the Advanced Edition of WDSC.
Before you start debugging programs, let’s take a look at the Application Diagram function.
The Application Diagram function provides a graphical view of the different resources in an
i5/OS native application and their relationships to each other. There are two different
diagrams that you can look at in the Application Diagram view:
• Source Call Diagram
• Program Structure Diagram
The Source Call Diagram takes ILE RPG source as input and displays a call graph showing
subroutine and procedure calls.
The Program Structure Diagram takes program and service program objects as input and
displays the binding relationships between them as well as the modules bound into each
program and service program.
To launch the Application Diagram function:
__ 1. In the Remote Systems view expand the Library list filter, if it isn't expanded
already.
__ 2. Expand library <team_lib>, if it isn't expanded already.
__ 3. Open the PAYROLLG.rpgle source member in the QRPGLESRC source file via the
LPEX editor.
Hint
Double-click the source member within RSE to open it in the LPEX Editor view.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-49
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Hint
You can also use the Application Diagram icon on the main workbench toolbar to launch
the Application Diagram function.
4-50 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Notice that the box around ACDESR is now highlighted and all relationship arrows
are highlighted. Arrows pointing away from the ACDESR subroutine point to
subroutines that ACDESR calls. Arrows pointing to subroutine ACDESR indicate
calls to ACDESR.
__ 6. Right-click the subroutine ACDESR and select Show Properties View.
The Properties view opens, and displays information about the currently selected
subroutine ACDESR.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-51
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 7. Select the Calls tab to view a list of the respective subroutines which ACDESR calls
and the source lines where the called subroutines begin and end.
The list of subroutines can be used to quickly jump to the specified line in the
source. Likewise the Called by tab shows the list of subroutines which call
ACDESR.
__ 8. Within the Calls tab list, double-click the CHGCDE subroutine line.
This takes you directly into the PAYROLLG source to the start of subroutine
CHGCDE.
4-52 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 10. You can save the application diagram as a text or image file. Right-click in a blank
open area within the Application Diagram view and select File -> Save As Image
File...
__ 11. The Save As Image File dialog will appear. Press the Browse button, select the
Desktop for the Destination Folder, press OK.
__ 12. Back on the Save As Image File dialog, enter AppDiagramPAYROLLG.gif for the
File Name: field, and press OK.
Optional: Locate this .gif file on your Windows desktop and double-click it, to view
the application diagram that you saved.
__ 13. Experiment a little bit with the Palette on the right-hand side of the Application
Diagram view.
Click on the Zoom button in the Palette to obtain a zoom tool; clicking within the
Application Diagram view will zoom the view to focus in more on the area that you
click with the zoom tool. Right-click within a blank open area of the Application
Diagram view to see more zoom options.
Click on the Note button in the Palette to obtain a note tool; clicking with the
Application Diagram view will let you create a note with text of your choice, to help
you annotate the application diagram with your comments.
__ 14. Close the Application Diagram PAYROLLG tab. If prompted to save changes, select
No.
__ 15. Close the PAYROLLG.RPGLE source member tab. If prompted to save changes,
select No.
You have spent some time familiarizing yourself with the Application Diagram
function, which allows a graphical view of a program’s call structure.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-53
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. In the Remote Systems view expand the Library list filter, if it isn't expanded
already.
__ 3. Expand library <team_lib>, if it isn't expanded already.
4-54 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
When a service entry point is created, a process for tracking service entries is
started on i5/OS (one process per i5/OS/userid combination). The i5/OS process
ends automatically when the WDSC workspace is closed, if the RSE connection is
disconnected, or if the user removes the service entry point.
__ 6. A message displays indicating the service entry point was successfully set. Press
OK.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-55
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Note
There is a possibility that you will get an error stating that you need to start the Debug
Server on i5/OS. Your instructor should have done STRSRVJOB on the i5/OS system for
you already, but in case you see this in your own work environment, here is how to correct
it:
The iSeries Service Entry Points view is automatically added to your workspace. It
lists all the defined service entry points. You can use this view to remove, enable,
disable, modify and refresh service entry points.
The default is to create a service entry point that will stop on entry into any module
(*ALL) or procedure (*ALL) within a program. The service entry point can be
modified after creation to stop at a particular procedure name or module name
within the program. Also, the program will only stop if the specified user ID is running
the program on i5/OS. The user ID can be changed via the modify operation.
4-56 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
Hint
Use the Start or Configure Session function of PCOMM or Pc5250 to define a connection
to <i5/OS_system>. Your classroom instructor may already have a shortcut to PCOMM or
Pc5250 on your Windows desktop for you. If you already have a 5250 session active, you
can use that session instead of starting and signing on to a new one.
If you have an existing 5250 session that is still associated to the RSE server job via
STRRSESVR, you need to release the interactive session. To do so, in the Remote
Systems view, right-click iSeries Objects and click Release Interactive Job on the pop-up
menu.
Note
Instead of the Enter key, you may have to use the Ctrl key in your 5250-emulation session.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-57
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 9. On the command line of the 5250 screen, enter ADDLIBLE <team_lib> where
<team_lib> is your team library from the lab information sheet. This will add your
team library to your interactive 5250 session’s library list.
__ 10. On the 5250 screen, enter CALL PGM(<team_lib>/CLR1) PARM(‘xx’) where ‘xx is
your team number. This will invoke your application program.
Note
For example, if your Team Number is 02, then type ‘02’ here. Do not forget the single
quotes around your Team Number. Make sure the PARM(‘02’) in the formed command
string looks OK before pressing Enter. If the PARM parameter is omitted, you will receive
an error when the CL program tries to call the payroll program.
As soon as the program enters the system, the service entry point is hit and a debug
session is started in WDSC and the Debug perspective appears with CLR1’s source
code in the editor. Your program is stopped at the first executable statement.
4-58 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 11. Click anywhere in the WDSC workbench to give the WDSC overall window
foreground focus.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-59
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
A dot with a checkmark in the prefix area indicates that a breakpoint has been set for
that line. The prefix area is the small grey margin to the left of the source lines
sequence numbers.
Now you will add a conditional breakpoint to stop in the loop when it loops the 99th
time.
4-60 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 1. Position the cursor on line 8 and make sure that line is selected.
__ 2. Right-click on line 8.
__ 3. Click Add breakpoint on the pop-up menu.
__ 4. Click the Breakpoints tab in the upper right pane of the Debug perspective.
The Breakpoints view is displayed.
__ 5. In the Breakpoints view right-click the breakpoint for line 8.
__ 6. Click Edit Breakpoint on the pop-up menu.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-61
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 7. Click Next.
__ 8. You only want to stop in the loop when it executes for the 99th time or more. You can
do that by setting the From field of the Frequency group to 99. Click Finish.
4-62 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty You have added a breakpoint including a conditional breakpoint to your source.
The variable appears in the Monitors view. Its current value is zero.
Now that some breakpoints are set, you can start to run the application.
__ 4. Click the Resume icon from the Debug toolbar.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-63
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
The program starts running and stops at the breakpoint at line 8. (The Debugger has
to stop 98 times but because of the condition you set, it continues to run until the
99th time.) Notice in the Monitors view, that &count now has the value 99.
__ 5. Click the Resume icon again.
The program stops at the breakpoint at line 8 again and &count now has the value
100.
__ 6. Click the Resume icon once more so that the program runs to the breakpoint at line
11.
You have monitored the variable &count.
The source of PAYROLLG is displayed. Depending on the Debug view option you
used to compile the program (*SOURCE, *LIST, or *ALL for ILE RPG), this window
displays either the Source or Listing View. If Debug view *ALL was used, you can
switch back and forth from Source to Listing via right-clicking in the source and
selecting Switch View.
Your instructor has compiled PAYROLLG for you already with the *SOURCE Debug
view option.
You have stepped into PAYROLLG program.
4-64 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
The stack entry allows you to work with and switch between different programs
and/or ILE modules.
You have viewed the call stack entries of your program.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-65
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 5. Click on line 87 (sequence number 000091) to select the source line, then right-click
and select Add Breakpoint.
Note
4-66 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty To view all breakpoints, select the Breakpoints tab from the top left pane.
This view shows all breakpoints currently set in your Debug session. This is a
convenient place to work with breakpoints. You can remove, disable and enable,
add, or edit a breakpoint. These tasks are available from the pop-up menu when you
right-click in the view area. Double-click any entry to show the source where the
breakpoint is set.
You have added several breakpoints to PAYROLLG.
The icon is removed from the prefix area indicating that no breakpoint is set on that
line. The breakpoint is also removed from the list in the Breakpoints view.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-67
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Note
You could also select and right-click anywhere in the source area of Line 58 (to the right of
sequence numbers) and select Remove Breakpoint from that context menu, to accomplish
the same thing.
The program starts running and runs to the breakpoint at line 57.
__ 4. Click the Resume icon again (or press F8, which is the keyboard shortcut).
The program waits for input from the 5250-emulation session. Switch to your 5250
emulator session.
4-68 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty You have removed a breakpoint from PAYROLLG, and resumed the program to stop at
another breakpoint.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-69
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 7. In the entry field, type in the new value X (uppercase) for the variable.
__ 8. Press Enter.
The variable is successfully changed. Notice how the icon for RSCDE in the
Monitors view has changed to indicate the variable has been altered via debug.
You have monitored several variables in PAYROLLG.
4-70 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
This will open the Memory view in the notebook at the bottom of the workbench
perspective. The tab within the view shows the name of the variable (ERR).
__ 3. Use the scroll bar on the right of the Memory view to scroll down.
You can see the current contents of the memory.
__ 4. Right-click in the view area within the memory contents table.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-71
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 5. Click Reset to Base Address on the pop-up menu to return to the starting address.
__ 6. To get the hex content of the memory starting with the selected variable ERR, right
click on this variable in the source view again, and this time, select Monitor Memory
> 2 Hex . A new page with the hex values is added to the Memory view. You will now
have an EBCDIC and Hex memory sub-view for the same ERR variable.
__ 7. Since you are only monitoring one variable’s memory storage, click the Toggle
Memory Monitors Pane button on the right-hand side of the Memory view to simplify
the information displayed by temporarily removing the Monitors column.
__ 8. Click on the EBCDIC sub-tab, and then click on the grey X to remove the memory
monitor rendering for EBCDIC, leaving just the Hex rendering.
4-72 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 9. Click the Toggle Split Pane icon, select EBCDIC for a rendering and click the Add
Rendering(s) button. This will give you a Hex memory rendering and EBCDIC
rendering side-by-side within the same view.
__ 10. Use the Link Memory Rendering Panes icon to control the scrolling of the memory
renderings side-by-side views. You can have the renderings scroll independently of
each other, or in synchronization with each other. Explore the scroll bar action with
the Link Memory Rendering Panes icon depressed and reset.
__ 11. Click the Toggle Memory Monitors Pane icon to re-display the monitored variable
column.
__ 12. Click each gray X (Remove Rendering) button for the Hex and EBCDIC renderings,
to remove them both.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-73
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 13. Click the XX (Remove All) icon to remove all variable memory monitors. When
prompted with the Remove All Memory Monitors message box, click the Yes button.
__ 14. Click the X on the Memory view tab, to close the Memory view.
You have added a memory monitor, and experimented with renderings for the variable
ERR.
4-74 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 1. Go to the Line number field at the bottom of the source area. In this field enter 116
and press Enter to go to that line.
Note
Line 116 will position the active source line at sequence number 000124.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-75
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
The Add a Watch Breakpoint window opens. The Expression field is pre-filled with
the highlighted variable *IN60.
By default the Number of bytes to watch field is set to zero, which means the
variable will be watched in its defined length.
__ 4. Click Finish.
The watch breakpoint is now set.
__ 5. Click the Resume button on the Debug toolbar.
The application waits for input from the 5250-emulation session.
4-76 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 6. In the 5250 emulation session, type 123 for Project Code and D (for delete) in the
Action Code field.
__ 7. Press Enter. A message is displayed indicating that the variable *IN60 has changed.
__ 8. Click OK. The program stops at line 465 (sequence number 000510). This line is
located immediately after the statement which caused the variable *IN60 to change.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-77
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 9. In the Breakpoints view, right-click the Watch breakpoint and click Disable on the
pop-up menu. This will uncheck the breakpoint selection box.
You have added a watch breakpoint for the variable *IN60 and run the program to see the
notification that the variable has changed.
Important
You may need to click the Resume icon again, if the 5250 application did not end. This will
depend on whether the project code has already been deleted indicator was turned on or
not.
Click OK.
4-78 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 5. Close both the CLR1.CLLE and PAYROLLG.RPGLE LPEX editor sessions by
clicking the X on their tabs.
__ 6. Right-click the Debug perspective icon at the top right of the workbench. Click
Close on the pop-up menu to close the Debug perspective and return to the Remote
System Explorer perspective.
Part 13: Starting the Integrated Debugger using the Debug action
You will still be working with the RPG program PAYROLLG.
Besides using service entry points to start a debug session, you can start the Debugger
directly from the pop-up menu of a program or service program in the Remote Systems
view, or from a Launch Configurations window. Starting directly from the Remote Systems
view does not allow you to specify parameters to be passed to the program. The Launch
Configurations window allows you to modify how the program is invoked and to specify
parameters.
CL program CLR1 requires a parameter.
To start the debugger:
__ 1. In the Remote Systems view expand the Library list filter, if it isn't expanded
already.
__ 2. Expand library <team_lib>, if it isn't expanded already.
__ 3. Right-click program CLR1 in library <team_lib>.
__ 4. On the resulting context menu, select Debug(Service Entry) > Remove Service
Entry Point. This will remove the service entry point we set earlier - in this lab
section we are explicitly going to start the CLR1 program after running STRRSESVR
to tie the 5250 emulation session with WDSC’s debugger.
__ 5. Right-click on program CLR1 again, and select Debug (Prompt)(J) > Interactive...
from the pop-up menu.
__ 6. On the My iSeries program (Interactive) Modify attributes and launch panel, clear
the contents of the Name: field, and type CLR1 . This gives your debug
configuration a unique name so you can use it again when you debug this program.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-79
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
By default, the page contains a call for the program and library for the object from
which RSE launched the debug wizard.
4-80 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-81
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Note
For example, if your Team Number is 02, then type ‘02’ here. Do not forget the single
quotes around your Team Number. Make sure the PARM(‘02’) in the formed command
string looks OK before pressing OK. If the PARM parameter is omitted or is an incorrect
format, you will receive an error when the CL program tries to call the payroll program.
4-82 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
The interactive connection is not currently active. Go to your 5250 emulation session
and start the interactive connection following the instructions in this message box.
You do not have to cancel the message box. It will be removed as soon as the
connection between the Remote System Explorer communications server and the
interactive session has been established. Now the Debug perspective will be loaded
into the workbench.
Hint
Copy the CL command text from step 2 in the message box into the 5250 emulation
session’s command line, to save some time.
Now that the program is active on the i5/OS server and stopped at the first
executable statement, the debugger displays the source.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-83
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
4-84 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 14. To get control back to the Debug session, click the Suspend icon.
You can now set breakpoints and use all the Debug features. You will also see the
source for PAYROLLG loaded into the Debug perspective.
Hint
Hint
You can also edit, delete and create debug configurations by clicking on Run on the
workbench main menu bar, and select Debug...
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-85
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Here you can see the CLR1 debug configuration. This is your saved configuration to
debug CLR1 as an interactive application. You could now modify this configuration
to use a different parameter, copy this configuration, or create a new one. Notice the
list of debug configurations you can choose from.
__ 18. Press Close. The intent here is just to view the way to view previously saved
configurations.
__ 19. Close all source member editor views (CLR1 and PAYROLLG).
__ 20. Close the Debug perspective to return to the Remote System Explorer perspective.
__ 21. Right-click on the iSeries Objects subsystem in the Remote Systems view, and
select Release Interactive Job to end the STRRSESVR linkage to the RSE server.
You have started the debugger using a debug action and viewed a saved debug
configuration.
4-86 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-87
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
4-88 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty
Note
Be sure to enter a blank space before the PARM parameter in the command string. Also,
you could press F4 in the Command to run: field to be prompted to add the parameter.
__ 5. Press OK to return to the Modify attributes and launch panel. You will now see your
parameter in the SBMJOB command string.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-89
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 11. Find your batch job in WDSC by expanding the iSeries Jobs subsystem, and then
right-click on My active jobs and select Refresh. Then expand My active jobs
folder, and then expand QBATCH.
__ 12. Your job will have <i5/OS_userid> for the job name and job user. Select and
right-click on this job, and select Debug As > iSeries Job
4-90 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty The Debug perspective will now open, and CLR1 source member will be loaded into
the view.
__ 13. In the Debug view, you can see that Thread:1 is stopped, and the active procedure
is a Function Check Exception Handler. Click on the CLR1 : CLR1 : CLR1
procedure under the Function Check Exception Handler line, and you will see the
CLR1 source view positioned to the instruction that caused the function check.
Note
Note that the source line with the failure is 1100 and the instruction is a CALL command.
This matches the information you saw on the Inquiry Message panel on the 5250 emulation
window.
You will need to look at the value of the &lib variable.
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-91
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 14. Double-click on &lib on line 1100 and then right-click and select Monitor
Expression.
__ 15. Click on the Monitors view tab, and you will see that &LIB is set to a library name
ending in 78. We do not have team numbers as high as 78, so this is not a valid
library name. You could confirm that using WRKLIB on 5250 or via a WDSC library
filter.
Now that you know what the problem is, you will terminate the debug session and
cancel the batch job.
__ 16. Click the Terminate icon on the Debug view toolbar.
__ 17. Close the CLR1 editor view, and then close the Debug perspective to return to the
Remote System Explorer perspective.
Your debug session is cancelled, but your job is still in Message Wait status on the
i5/OS server.
4-92 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
EXempty __ 18. Back on your 5250 emulation window, respond C on the Inquiry Message window to
cancel your batch job, and press Enter.
End of exercise
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-93
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
4.4. Quiz
Now you are ready to review your knowledge of this module by taking the quiz. You can
also apply what you have learned in this module by completing the practice tasks detailed
in “More practice” on page 4-95.
__ 1. You can start the debugger:
a. From the Remote Systems view
b. Launch Configurations window
c. From a Service Entry Point
d. All of above
__ 2. You can only set breakpoints at executable lines. (T, F)
__ 3. The debugger allows you to:
a. Step over a program call
b. Step into a called program
c. Both
__ 4. The Debug view lists all call stack entries. It contains a tree view for each thread. (T,
F)
__ 5. Adding a storage monitor for a variable allows you to view the storage starting with
the address where the variable is located. (T, F).
__ 6. A _________ breakpoint provides a notification to a user when a variable changes.
It will suspend the execution of the program until an action is taken.
a. Watch
b. Line
c. Conditional
4-94 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Student Exercises
© Copyright IBM Corp. 2005, 2008 Exercise 4. Debugging source code 4-95
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
4-96 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
5-40 System i Application Development Using WDSC 7.0 © Copyright IBM Corp. 2005, 2008
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
backpg
Back page
®