The
BookWrapper.cbl interface has a similar interface to
Book.cbl but updated to turn the file status into a string and a numeric value, and pass it back in
lnk-status-group. The
setup-status section does the conversion.
procedure division using by value lnk-function by reference lnk-b-details lnk-status-group.
The
BookWrapper.cbl program is compiled with the ILSMARTLINKAGE directive which creates classes to represent the PROCEDURE DIVISION parameters. In the
bin folder will be
Details.class and
StatusGroup.class. This will be seen in action in the creation of the bridge code between the server code and the COBOL application.
Create the project
- Select
File > New > COBOL JVM Project.
- Set
Project Name to
BookWrapper
- Click
Finish.
- Open the project's
Properties dialog box to set the compiler directives.
- Click
Build Configuration then
Apply. A
Build Configuration tab will be displayed.
- In the
Additional directives text box enter:
ilnamespace(com.microfocus.bookwrapper) ilsmartlinkage ilcutprefix(lnk-b) ilcutprefix(lnk-) warnings(3)
- Click
OK to finish.
Add the COBOL source files
The project uses one source file,
BookWrapper.cbl, that needs to be imported into your project.
- Right click on the
src folder in COBOL Explorer and select
Import > Import > General > File System.
- Click
Next.
- Click
Browse and navigate to
<tutorial_source_folder>\BookWrapper\src.
- Click
OK.
- Select
src in the left-hand pane.
- Click
Finish to import the files into the project.
Set the copybook path
The copybook path needs to be set to point to the COBOLBook project.
- Open the BookWrapper project's Properties dialog box.
- Select
Micro Focus > JVM Build Path.
- Click on the
Projects tab and click
Add..
- Select COBOLBook and click
OK.