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
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
Next, the Enterprise Developer Resource screen appears (Fig. 3).
Figure 3. Initial Eclipse screen
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
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
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
A series of panels requests the specification of a number of vital pieces of information. These are:
- 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
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
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
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
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
The following three panels (COBOL, Assembler and PL/I Settings) have four tabs on each of them (Fig. 12). These are:
- Compiler Options
Setting Compiler Options
Figure 12. Setting COBOL compiler options
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
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
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 *
//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
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 17. Specifying the runtime options
Figure 18. Completing the system setup
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
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
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
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 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
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
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
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
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
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
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
A panel opens, requesting a member name (Fig. 31).
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
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
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
A panel opens, requesting confirmation of where to write the generated JCL (Fig. 35).
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
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
Submitting the JCL and seeing the results
Right-click on the JCL member name to Submit it (Fig. 38).
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
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
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
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.
Dig deeper into WebSphere on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Keep up with the best and latest technical info to help you tackle your development challenges.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.