ILSMARTNEST

Use in conjunction with ILSMARTLINKAGE, to expose the Linkage Section items and entry points to managed code (such as C# or Java) as nested classes of the program class in which they are defined.
Restriction: This directive is supported for JVM COBOL only.

Syntax:

>>-.---.-.----.-ILSMARTNEST------><
   +-\-+ +-NO-+

Properties:

Default: NOILSMARTNEST
Phase: Syntax check
$SET: Any
IDE Equivalent:

Comments:

By creating nested classes, programs within the same compilation unit can have linkage records with the same name.

Example:

The following COBOL program is compiled with ILSMARTLINKAGE, ILSMARTNEST, ILCUTPREFIX(lnk-b-) and ILCUTPREFIX(lnk-):

       program-id. BookLegacy.
						 ...
       linkage section.
       01 lnk-function            pic x.
       01 lnk-b-details.
          03 lnk-b-text-details.
             05 lnk-b-title       pic x(50).
             05 lnk-b-type        pic x(20).
             05 lnk-b-author      pic x(50).
          03 lnk-b-stockno        pic x(4).
          03 lnk-b-retail         pic 99v99.
          03 lnk-b-onhand         pic 9(5).
          03 lnk-b-sold           pic 9(5).
       procedure division using by value lnk-function
                                by reference lnk-b-details.

In Java, you can access the data in BookLegacy program in JVM COBOL as follows:

    BookLegacy myBook = new BookLegacy();
       //creates an object corresponding to the BookLegacy program
    BookLegacy.Details myDetails = new BookLegacy.Details();
       //creates an instance corresponding to the group lnk-bdetails
    . . .
       myDetails.setStockno("6666");
       myDetails.setTitle("JVM COBOL");
       myDetails.setAuthor("Mike Focus");
       myDetails.setType("Reference");
       myDetails.setRetail(BigDecimal.valueOf(155, 5));
       myDetails.setOnhand(20);