 | Import the COBOL program into a Web service for CICS Project
You will now create a Web service for your CICS project, and import the COBOL
program LAB3POT and its required copybooks to this project.
Note that you could do this directly from the z/OS system if you were connected
to the z/OS.
LAB3POT is the CICS COBOL program, which you have previously tested. This
program is on your workstation but also at your dataset xxx.POT.COBOL.
You need to import the COBOL program LAB3POT that you will use in the Web
services dialog.
- Click the EST Project Explorer tab to switch to the Project Explorer
view.
- Using the Enterprise Service Tools perspective and the EST Project
Explorer view, right-click LAB3_CICS_Services, and select
Import > Source Files, as shown in Figure 10.
Figure 10. Using the Enterprise
Service Tools Perspective and the EST Project Explorer view
- Click File System (because your file is on your workstation) and make
sure that *.cbl is specified in the Files of type field, as shown in Figure 11.
Figure 11. Step 2: Using the
Enterprise Service Tools Perspective and the EST Project Explorer view
- Navigate to C:\RDZ_POT_V7\LAB3, select LAB3POT.cbl, and click
Open, as shown in Figure 12.
Figure 12. Navigating to the
saved file
- Verify that the program to be imported is correct, and then click
Finish, as shown in Figure 13.
Figure 13. Verify the
program
- Repeat these steps to import the two copybooks that are part of this code,
as follows: Right-click LAB3_CICS_Services, and select Import
> Source Files > File System.
- In the Files of type field, click the drop-down list and select
*.cpy, as shown in Figure 14.
 |
Copybook FAQs
Q: How do I find the required COPYBOOKS used in the COBOL code?'
A: If you import your code from the z/OS (remote), you can determine
the required copybooks in Rational Developer for System z by using the Check
Dependencies capability.
Q: Can I use just the DFHCOMMAREA copybook instead of the whole
program?
A: Yes, you can use only data structures. But the copybook (*.cpy) is
expected to have the whole structure that would include the 01 level (or 77
levels). You do not need to have the whole program, and the wizard can accept
only the data structure that has the DFHCOMMAREA (or container). However, if
you do decide to use a program, then it must be complete (with all copybooks).
This tutorial uses the complete program so that you can understand it. In this
case you will need all of the required copybooks, otherwise the wizard will
flag the compile errors. You can also change More COBOL Options by selecting
Windows > Preferences > Importer > COBOL if you need
extensions other than *.cpy for the data structure.
|
|
Figure 14. Selecting the file
type from the dropdown list
- Using the Ctrl key, select COMAREA.cpy and POTVSAM.cpy, and
then click Open, as shown in Figure 15.
Figure 15. Selecting the .cpy
files
- Verify that the copybooks to be imported are correct, and then click
Finish, as shown in Figure 16.
Figure 16. Verifying the
copybooks
- The imported code should appear as shown in Figure 17.
 |
What you have done so far
You have created a project to hold the Web Services components and imported
the LAB3POT program and its components to this project.
Now you
are ready to start the Web services wizards that will generate the necessary
components to create the CICS Web Services.
|
|
Figure 17. The imported code
- Note that you have imported the COBOL program LAB3POT and two copybooks.
This is the program that is invoked by the client COBOL, and that retrieves
the data from the VSAM file. Double-click the LAB3POT program and take a few
minutes reviewing it to understand this program, as shown in Figure 18.
Figure 18. Reviewing the
program
- Close the editor (Ctrl+F4).
|  |