Developing CICS/COBOL programs using WebSphere Studio Enterprise Developer

This article is a basic "cheat-sheet" for those who are new to WebSphere Studio Enterprise Developer and want to use it to write COBOL/CICS mainframe applications. It assumes no prior knowledge of the products involved.

Grant Able (wardable@uk.ibm.com), Solution Tester, IBM, Hursley

Photo of Grant Ward AbleGrant Ward Able is a former Systems Programmer with over 15 years experience in CICS, MQSeries, and MERVA. He now works in WebSphere Platform Solutions Test (WPST), part of IBM Software Group. WPST is responsible for implementing and testing end-to-end business scenarios. You can contact Grant at wardable@uk.ibm.com



01 February 2004

Introduction

Any time you are faced with a new development tool or IDE, you go through a learning curve finding out before you are able to use it efficiently and productively. If you are a COBOL/CICS programmer interested in investigating WebSphere Studio Enterprise Developer (hereafter called Enterprise Developer) for mainframe COBOL development, this article will help shorten that learning curve.

While the article focuses on COBOL, Assembler and PL/I programmers should be able to apply the information fairly easily. If you want, you can configure all three language settings and then use the defined z/OS system to develop applications in any of the three languages. The main purpose of this article is to make the configuration of the product for mainframe connectivity as easy as possible, and it is tailored for someone starting up Enterprise Developer for the first time.

This article assumes that all of the required products and their pre-requisites have been installed, in particular that Enterprise Developer V5.0 has been installed on both the workstation and z/OS. The article does not describe the installation process -- for information on that, see the WebSphere Studio Enterprise Developer Installation Guide. The article describes how to do the following tasks -- all from within Enterprise Developer:

  • Configure a connection to the mainframe (z/OS) system).
  • Create a project to work with (z/OS project).
  • Create datasets on the mainframe.
  • Create a member within a PDS.
  • Generate JCL.
  • Submit JCL.
  • Look at the results of the submitted batch job.

Apart from installing the required software on the mainframe, there is no longer a need to log on to TSO.


Starting Enterprise Developer

To start Enterprise Developer, select Start => Programs => IBM WebSphere Studio => Developer 5.0.

A panel asks you where you want the workspace to be located:

Figure 1. Identify workspace location
Figure 1

Click OK. A splash screen is displayed for a few seconds before the main Enterprise Developer Eclipse screen appears (Fig. 2).

Figure 2. WebSphere start-up splash screen
Figure 2

Next, the Enterprise Developer Resource screen appears (Fig. 3).

Figure 3. Initial Eclipse screen
Figure 3

Creating a connection to a z/OS system

Before using Enterprise Developer, define a z/OS System and a z/OS Project. Select Window =>Open Perspective =>z/OS Systems (look in Other to find z/OS Systems).

This perspective opens with a view as shown in Fig. 4.

Figure 4. Opening a perspective
Figure 4

Choose Other as shown in Fig. 5 to be presented with the z/OS Projects panel, as shown in Fig. 6.

Figure 5. Choosing the z/OS Projects perspective
Figure 5

Select Remote Systems => Add System to add the connection to your mainframe z/OS system.

Figure 6. Beginning to add a z/OS System to your z/OS Project
Figure 6

A series of panels requests the specification of a number of vital pieces of information. These are:

  • Host
  • MVS user id
  • Job port

The first panel (Fig. 7) requests information about the host to connect to.

Figure 7. Specifying details for your z/OS host System
Figure 7

After creating the connection to the z/OS System, a remote system with the Host Short Name is shown.

The ID that connects to the host is MVS User Id.

Foreign File System (FFS) Port must match the port number specified in the Web Server that acts as the FFS Server, in the "-p" parameter of the ICSPARM keyword.

The z/OS Job Monitor has a parameter, SERV_PORT that Job Port must match up with.

If a system properties file is supplied (by your system administrator), click on Import system definition... Choose the file from which to import (using the standard Windows file selection panel). Fig. 7 is then presented, but all the details of Fig. 7 are completed EXCEPT for the MVS User ID on this panel. Fill this in and click Finish.

Fig. 8 defines the Build Server port authorization level.

Figure 8. Specifying Build Server port details
Figure 8

The port specified here must match that specified on the Build Server for z/OS, in the "-p" parameter.

Next specify which dataset name high-level qualifiers are to be used on this system (Fig. 9).

Figure 9. Specifying dataset names for your system
Figure 9

This is automatically filled in with the value specified in the MVS User ID field of Fig. 7.

To add other high-level qualifiers, click on New. A panel opens for specifying the dataset names. Note: these are the datasets for browsing, editing or creating from this system. Other datasets need to be specified.

Enterprise Developer displays all PDS members with an extension, and specifies how datasets/members are transferred between desktop and host, as shown in Fig. 10. There are a number of predefined extensions. For most systems, you can leave them as-is.

Figure 10. Workstation file extensions
Figure 10

This can be changed, but for the moment, click Next to move to the Job Card specification (Fig. 11).

This should be changed as required by your individual site installation. If necessary, contact the MVS System Programmer for assistance on what should be specified.

Figure 11. Specifying the JCL for your JOB statement
Figure 11

The following three panels (COBOL, Assembler and PL/I Settings) have four tabs on each of them (Fig. 12). These are:

  1. Compiler Options
  2. CICS
  3. DB2
  4. IMS

Setting Compiler Options

Figure 12. Setting COBOL compiler options
Figure 12

The compiler option SQL is only required when coding for a DB2 program. Similarly, the CICS("COBOL3") parameter is only required for CICS programs. The Listing Output Data Set and Object Deck Data Set need to be created and there are instructions are provided for this (and a number of other datasets) in the Online Help (search for: Allocating z/OS data sets from WebSphere Studio).


Setting CICS Options

The next tab on this panel is for setting up CICS-specific values (Fig. 13).

Figure 13. CICS settings for COBOL programs
Figure 13

On the CICS tab of the COBOL SETTINGS panel, you can choose the Integrated CICS translator or the separate CICS translator. You can also choose to have a new copy of your program taken.


Setting DB2 Options

Figure 14. DB2 settings for CICS COBOL programs
Figure 14

When writing a DB2 program, update values on the DB2 tab (Fig. 14).

If compiling DB2 programs, the SYSTSIN Instructions have to be started by writing the following DD statement yourself:

//SYSTSIN DD *

or

//SYSTSIN DD DSN=xxx.yyy.zzz,DISP=SHR

Similarly, using IMS, update that tab.

When working with PL/I and/or Assembler, use the next two panels (not shown in this document). Otherwise, click Next until the €˜Link Options€™ panel (Fig. 15) is reached.

Figure 15. Specifying settings for the binder
Figure 15

For CICS COBOL programmers, click Next until you are presented with the Setup Complete panel (Fig 18). For CICS COBOL programmers, this will be three clicks on Next after filling in Link Options panel (Fig 17).

The next three panels shown (Fig. 16 to Fig. 18) are those that would be shown when clicking Next as described above.

Figure 16. Settings for the binder input
Figure 16
Figure 17. Specifying the runtime options
Figure 17
Figure 18. Completing the system setup
Figure 18

The Setup Complete panel (Fig. 18) lets you export system properties and is the only place you can do so.

It is a good idea to export them now, not the least for backup reasons.It is possible to connect to the system at this stage (Fig. 19). This is optional, but it is a good test to check that the system has been configured correctly.

Figure 19. Connect to the new system
Figure 19. Connect to the new system

To continue with the creation of a z/OS Project, disconnect (if connected) by right-clicking the system and choosing Disconnect.


Creating a z/OS Project

To create a z/OS Project, open the z/OS Projects perspective. Select Window => Open Perspective => z/OS Projects (HINT: look in Other... to find z/OS Project).

Figure 20. Create a new z/OS project
Figure 20. Create a new z/OS project

Right-clicking in the blank space of the z/OS Projects pane enables the selection of New => MVS Project (Fig. 20).

Name your project and choose which z/OS System (Host Short Name) and High Level Qualifier to associate with the project (Fig. 21). As a project inherits all the properties from the associated System (at creation time), click on €˜Finish€™ now and accept all the properties of the z/OS System.

Figure 21. MVS Project details
Figure 21. MVS Project details

Before writing code or compiling programs, some datasets need to be created. To do this, connect to your z/OS System. Go to the z/OS Systems perspective and right-click on the z/OS System, then choose Connect (Fig. 22).

Figure 22. Connect to the remote system
Figure 22. Connect to the remote system
Figure 23. Entering your password
Figure 23. Entering your password

Enter (or click OK) to be signed onto the z/OS system. Begin to create the datasets needed, unless these have been done previously.


Defining a PDS

In the z/OS Systems view, you right-click on your MVS User Id and choose Allocate PDS... which shows the panel in Fig. 24.

Figure 24. Allocating a PDS file
Figure 24. Allocating a PDS file

Enter the name of the dataset to be created. The High Level Qualifier is added as a prefix to the dataset name. Click Next to choose between modeling the dataset on an existing one, using some models, or specifying the values for all parameters manually. In this example pre-set models are used, achieved by clicking the Specify characteristics by usage type button (Fig. 25).

Figure 25. Settings for PDS file allocation
Figure 25. Settings for PDS file allocation

Ensure that the pre-set values are correct for the installation and alter those that might need changing, such as the Block Size:

Figure 26. Dataset characteristics
Figure 26. Dataset characteristics

Clicking Finish causes a TSO ALLOCATE command to be issued on z/OS with all the correct parameters according to the specifications in Fig. 26. When all the datasets are created, they need adding to the project before they can be used.

Figure 27. Adding a file to your project
Figure 27. Adding a file to your project

To do this, select the datasets (individually or by pressing Ctrl and clicking each dataset to be added). Right-click the highlighted datasets and choose Add to Project (Fig. 27), which gives the following screen:

Figure 28. Selecting the project
Figure 28. Selecting the project

Here, all that is needed is to select which project to add the dataset(s) to and click Enter. The project should now look like Fig. 29:

Figure 29. Selecting the project
Figure 29. Selecting the project

Creating a PDS Member

Create a PDS member in which to put the application code. Right-click on the source library and choose Create PDS Member... to do this (Fig. 30).

Figure 30. Create a PDS member
Figure 30. Create a PDS member

A panel opens, requesting a member name (Fig. 31).

Figure 31. Entering the PDS member name
Figure 31. Entering the PDS member name

The newly-created member opens, allowing you to enter your code. Notice that the system adds an extension to the member name, for example, .cbl for COBOL or .asm for Assembler (Fig. 32). This is dependant upon the low level qualifier on the Host Data Set name, as defined previously (Fig. 10).

Figure 32. The new PDS member with COBOL source
Figure 32. The new PDS member with COBOL source

Only after the data has been saved (CTRL+S) is anything seen in the Outline pane (Fig. 33).

Figure 33. The outline pane shows only after the source has been saved
Figure 33. The outline pane shows only after the source has been saved

Generating JCL

To compile the code, generate some JCL to execute the compilation job. To achieve this, right-click on the member name in the project pane. The For Compile Link option generates steps to do both the compile and link (Fig. 34).

Figure 34. Generating JCL for Compile and Link
Figure 34. Generating JCL for Compile and Link

A panel opens, requesting confirmation of where to write the generated JCL (Fig. 35).

Figure 35. Specifying where the JCL is to be created
Figure 35. Specifying where the JCL is to be created

A message box pops up once the JCL generation is complete (Fig. 36).

Figure 36. JCL generation confirmation
Figure 36. JCL generation confirmation

By expanding the JCL library then double-clicking on the member name it opens to show (or edit, if so desired) the generated JCL (Fig. 37). Once generated, it can be submitted over and over again without the need to re-generate it. Only if some underlying property changes occur, does the JCL need re-generating.

Tip: Double-click on the tab (for example, MYPROG01.JCL in Figure 37) maximizes the window, while double-clicking on it again causes it to revert back to its previous size.

Figure 37. Sample JCL
Figure 37. Sample JCL

Submitting the JCL and seeing the results

Right-click on the JCL member name to Submit it (Fig. 38).

Figure 38. Submitting the JCL
Figure 38. Submitting the JCL

This puts an entry into the Tasks pane, displaying the JES number of the submitted job (Fig. 39).

Figure 39. Submitted JCL shows in the Tasks pane
Figure 39. Submitted JCL shows in the Tasks pane

To see if the compilation and link were successful, inspect the job output. To do this, right-click on the JCL member again, this time selecting Get Job Output (Fig. 40).

Figure 39. Submitted JCL shows in the Tasks pane
Figure 40. Getting job output for viewing

This retrieves the job output into the z/OS Output Console, where it can be perused at leisure (Fig. 41).

Figure 39. Submitted JCL shows in the Tasks pane
Figure 41. Job output in the z/OS Output Console

If the job was successful, you should to see an entry for the program in the LOAD library. This shows in Enterprise Developer with an extension of .exe. If there was a programming error, alter the code and re-submit your job. If the error was in the JCL, then contact your Administrator or Systems Programmer in order to get the correct information from them. Once you have the correct information, you will then have to go to your z/OS Systems, right-click on it, choose Properties and make the correction there. You will then have to re-generate the JCL.

Congratulations! You have successfully used WebSphere Studio Enterprise Developer to create a system connection, a project, and some datasets, and then edited and compiled some source code.

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into WebSphere on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=14119
ArticleTitle=Developing CICS/COBOL programs using WebSphere Studio Enterprise Developer
publish-date=02012004