| < Day Day Up > |
|
You can use WSAA to extract specific lines of code to create a new compilable program. You can extract code only from a COBOL program if it has successfully completed the inventory collection process. When you extract a segment of code, select lines of code that other programs can use and that contain COBOL statements such as CALL or MOVE.
Two files are created when you extract code:
Code extract file, which contains the lines of code extracted from a COBOL program in your inventory.
Complement file, which contains the lines of code that were not extracted from the original COBOL program.
Restriction: | The complement file is created only if you have selected one or more contiguous lines of code. If you select lines that are non-contiguous, WSAA is not able to create a complement file. |
When the complement file is created, a COBOL CALL statement is added to invoke the code extract file. If the code extract file and the complement file are created without any errors, you can compile these two files and link each of them into load modules. When you invoke the complement module, it should perform the same function as the original COBOL program.
To extract code from TRADERB, perform the following steps.
On the Data element summary page that was shown in Figure 5-3 on page 143, click TRADERB. The Program detail page is displayed, as shown in Figure 5-8.
Figure 5-8: Program details page for TRADERB
Click Code extraction. The Code extraction page is displayed, as shown in Figure 5-9.
Figure 5-9: Code extraction page, preliminary view
If necessary, change the high-level qualifier of the output data sets to match your TSO user ID.
Note | Pay particular attention to the note underneath these fields. You must pre-allocate these output data sets, otherwise WSAA will issue an error message. |
Scroll through your program to find the segment of code that can be used as a stand-alone process. In this example, we found the READ-CUSTOMER-FILE section was a suitable candidate.
Select the text to highlight it, as shown in Figure 5-10.
Figure 5-10: Code extraction page, with selected text highlighted
Click the Process button. WSAA processes the information and displays the results in the Code extraction page, as shown in Figure 5-11.
Figure 5-11: Code extraction page, after processing
Log on to an OS/390 or z/OS system.
Go to ISPF Option 3.4.
Enter the names of your data sets using a format similar to the following:
DNET998.*.COBOL
Browse the contents of each output file.
Note | Unfortunately, this function did not work for us on the DemoMVS system. We have reported the problem to WSAA Support. At the time this chapter was last reviewed, we were still awaiting a fix. |
WSAA is supposed to create the two COBOL programs, with the appropriate heading in the extract file and the appropriate linkage section in the complement file.
| < Day Day Up > |
|