This tutorial shows you some of the functionality of Rational® Developer for System z® in the context of
running a COBOL application on a remote system. It explains how to
allocate a partitioned data set, create a z/OS® project, build executable code from COBOL
source, run an application on the remote system, and debug an application
on the remote system.
Before you start this tutorial, make sure that your z/OS system administrator has configured
and started the z/OS build
server and Remote System Explorer server. Refer to the Host
Configuration Guide on installation CD 1 for information on
installing and configuring these required components.
- Switch to the z/OS Projects perspective:
- In the workbench, select Window > Open Perspective
> Other. The Select Perspective wizard
opens.
- Click z/OS Projects.
- Click OK. The z/OS
Projects perspective opens.
- Create a connection to a remote system:
- In the Remote Systems view, expand New
Connection and select z/OS.
- Right-click and choose New Connection. The New Connection window opens.
- Select a profile name from the drop-down list.
- Enter the following values in the fields on this window.
- Host name
- Enter the TCP/IP address of the system you are connecting to.
- Connection name
- Enter the short name you want to call the system. For example, MYSYSTEM.
- Description
- Enter a description of your choice.
- Verify host name
- Select this check box to verify that the host name is valid before
attempting to connect.
- To define the connection using default values for the MVS
Files, z/OS UNIX Files, and z/OS
UNIX Shells subsystems, click Finish. To
set properties for these subsystems, click Next. The wizard opens a properties window for each subsystem.
These pages display the properties of the underlying services used
by each subsystem.
- On the MVS Files page, you can
select from the following server launchers. If you are not sure which
option to choose, contact your system administrator.
- Remote daemon: Establishes a connection
using the remote daemon to start the server. To use this option, the
remote daemon must be running on the remote system. If you choose
this option, specify the following additional options:
- Daemon Port: Specify a valid port number.
- Authentication method: Choose
a method for authenticating with the remote system. Select userid/password if
you log on to the remote system using a user ID and password. Select certificate if
you use client certificate authentication. Client certificate authentication
is for users who need to connect to a remote system using a device
such as an integrated circuit card (like Smart Card). See Creating a connection using client certificate authentication for more information.
If you choose this option, you must start the server daemon using
a user ID with appropriate privileges.
- REXEC: Establishes a connection using the
REXEC service to start the server. To use this option, the REXEC service
must be running on the remote system. If you choose this option, specify
the following additional options:
- Path to installed server on host: Specify
a valid path command to where the server is installed on the remote
system. You can specify a path that is relative to the directory where
you run the REXEC command or the full path to the location where the
server is installed. For example, dstore or /usr/bin/dstore.
- Server launch command: For zSeries®, the command is server.zseries.
- Port: Specify a valid port number.
- Auto-detect SSL: Automatically detects
if SSL is running on the server and connects using SSL.
- Use SSL for network communications: Connects
using SSL.
- Connect to running server: Establishes
a connection with a server that is already running on some known port.
To use this option, the server needs to be started before you attempt
to define a connection in the Remote System Explorer. The port must
be specified on the Subsystem properties page before you can connect
to the server. If you choose this option, you also need to specify
the Use SSL for network communications option,
which connects using SSL
- SSH: Establishes a connection using secure
shell support. To use this option, the SSH service must be running
on the remote system. If you choose this option, specify a valid path
command to where the server is installed on the remote system. You
must also specify a server launch command. For zSeries, the command is server.zseries. Select Password
authentication authentication if you log on to the server
using a password or key authentication if you
log on using a private/public key pair to authenticate with the server.
If you choose key authentication and the key pair does not exist,
the required key pair is automatically generated and exchanged with
the remote SSH server for future requests. You are prompted for a
password to the remote system to enable this exchange. Any subsequent
requests to the remote system through SSH using key authentication
do not require a password.
- Click Finish. The Remote
Systems view displays the short name of the new connection
with five nodes under the connection name:
- z/OS UNIX Files is the z/OS UNIX file
subsystem. This node contains two folders: My home and Root. You
can create additional z/OS UNIX file folders by adding new
filters to this node.
- z/OS UNIX Shells is a command subsystem.
When you open a z/OS UNIX command shell, its name appears
under this node.
- MVS Files is the MVS™ file subsystem. This node contains three
folders: My Data Sets displays MVS files that match the filter userid.*
in which userid is the user ID with which you connected
to the remote system. You can create additional MVS file folders by adding new filters to this
node. You can change the sort order of data sets by using the MVS
Files preference page. Retrieved Data Set displays
data set names searched for and added by using the Retrieve
Data Sets action. My Search Queries displays
search queries you have run and saved in the Remote z/OS
Search view.
- TSO Commands is a command subsystem. When
you open a TSO command shell, its name appears under this node.
- JES is the JES subsystem. This
node contains two folders: My Jobs displays
jobs submitted under the user ID with which you connected to the remote
system. You can create additional job folders by adding new filters
to this node. Retrieved Jobs displays jobs
searched for and added by using the Retrieve Job action.
- Connect to the remote system:
- Select the remote system connection in the Remote Systems
view and click Connect.
- In the Enter Password window, type
your user ID and password and click OK.
- Allocate partitioned data sets on the remote system. Use the steps described below this list of data set names to
allocate each partitioned data set using these characteristics. In
the following partitioned data set names, <HLQ> is
the user ID you used to log on to the remote system:
Table 1. | Data set name |
Category |
Type |
| <HLQ>.REMOTE.COBOL |
SOURCE |
COBOL |
| <HLQ>.COBOL.OUTPUT* |
LISTING |
COBOL |
| <HLQ>.COBOL.SYSDEBUG* |
LISTING |
COBOL |
| <HLQ>.COBOBJS.OBJ* |
SOURCE |
COBOL |
| <HLQ>.COBOL.COPYLIB* |
SOURCE |
COBOL |
Note: The data sets marked with * are data sets required by
the COBOL step of the ELAXFCOC procedure described in step
7 These data set names must match the data set names
referred to in the COBOL step options.
For each of these data
sets, do these steps:- Select the MVS Files subsystem
in the Remote System view and click New > Allocate Partitioned
Data Set.
- On the Allocate Partitioned Data Set page,
do these tasks:
- Accept the name that is provided in the Host Short
Name field.
- Select the high-level qualifier for the data set from the drop-down
list.
- In the Data Set Name field, specify the
name that follows the combination of high-level qualifier and period.
For example, if the high-level qualifier is MYFILES and
if you want to allocate the data set MYFILES.REMOTE.COBOL, specify
the string REMOTE.COBOL in the Data
Set Name field.
- Click Next.
- On the Data Set Allocation page,
select the Specify characteristics by usage type radio
button and then select the corresponding value from each list box
as shown in the table.
- Click Finish.
- Obtain sample source code for this tutorial:
- Click File > New > Example. Expand Workstation
COBOL and click COBOL Sample 1 in
the list. Click Next.
- Specify LocalCOBOLSample as the project name and click Finish.
- Copy the COBOL source files, PrintApp.cbl and StartApp.cbl,
to the <HLQ>.REMOTE.COBOL partitioned
data set.
- Create a z/OS project
and MVS subproject:
- In the z/OS Projects view, click New
> z/OS Project. The New z/OS
Project wizard opens.
- In the Project name field, type SampleProject.
- Select Create an MVS subproject and
click Finish.
- In the Subproject Name field,
type RemoteCOBOLSample. The High-level
Qualifier defaults to the user ID with which you logged
on to the remote system.
- In the Property Group area of
the New MVS Subproject window, click Create
a new property group and associate it with the subproject.
- Name the property group SamplePropGroup.
- Click Finish to edit the property
group.
- To set build options in the new property group:
- In the property group editor, click the COBOL tab
and then click Procedures and Steps.
- Expand the ELAXFCOC procedure
and double-click COBOL to edit the COBOL step.
- Copy and paste the following JCL into the Additional
JCL text box:
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
Ben
Q
/*
//
- Click the JCL tab in the property
group editor and ensure that the default JOB card includes a PROCS
statement that points to the procedure library on the remote system. If you do not know the location of the procedure library, ask
your system administrator.
- Close and save the new property group.
- Add the <HLQ>.REMOTE.COBOL partitioned
data set to the RemoteCOBOLSample subproject:
- Select the data set in the Remote Systems view.
- Right-click and select Add to Subproject.
- Type or select the subproject name and click Finish.
- Build and run the application:
- In the RemoteCOBOLSample subproject, select STARTAPP.cbl and
click Nominate as Entry Point.
- Select RemoteCOBOLSample and
then click Rebuild Subproject. At
the end of the build operation, the listings, object decks, and generated
load module are added to the subproject.
- Select the generated load module, and click Run
> Run to run the application. Alternatively, you can click Run
> Debug to debug the application.