To create a new COBOL JVM Project:
This opens the New COBOL JVM Project dialog box.
The project is displayed in the COBOL Explorer.
To create a new package:
This creates my.pack in the src folder.
Create the following COBOL program in the my.pack package:
This opens the New COBOL Program dialog box. The Source folder field already contains CJVM/src. The Package field already contains my.pack.
This opens the Calculator.cbl program in a COBOL editor.
$set ilnamespace "my.pack" program-id. Calculator as "Calculator". data division. working-storage section. linkage section. 01 lnk-arg1 pic 9(5) comp-3. 01 lnk-arg2 pic 9(5) comp-3. 01 lnk-sum pic 9(5) comp-3. procedure division using by value lnk-arg1, by value lnk-arg2, by value lnk-sum. add lnk-arg1 to lnk-arg2 giving lnk-sum. goback. end program Calculator.
Setting a namespace using the $SET statement, $set ilnamespace "my.pack", is equivalent to package identification in Java.