Previous Topic Next topic Print topic


Create and Define the Next Operation

  1. Right-click the word Operation below the title bar, and click New on the popup menu.

    Using this popup menu is an alternative to the pulldown menu we used before.

  2. In the Name field, type Next.

    The Select program list shows that book is already selected for you. This is because each service interface can use only one program, and you specified the book program in the Add operation we defined earlier for this same service interface.

  3. From the Select entry point list, click book; then click OK.

    The Interface Fields and COBOL Assignments panes for the new operation are blank in anticipation of new definitions for this operation.

  4. Based on the instructions for the Add operation, define a COBOL Assignment for the lnk-function field and set its value to 4. This is the value that instructs the program to get the next record.
  5. Create an interface field named lnk_file_status from the COBOL Entry Point field link-file-status; then set its direction to Output.

    The program action that retrieves the next record gets the required record from the data file and returns it. So we need a set of output fields in which to return the fields of this record.

  6. Drag lnk-b-details from the COBOL Entry Point pane to the Interface Fields pane.

    The new interface field created is called lnk_b_details. As we did when defining the Add operation, we will change the field name to ensure that it is different from the name used for similar groupings in the other operations for this interface.

  7. Double-click the lnk_b_details field name in the Interface Fields pane and change the name to nextop_details; then click OK.
  8. Fully expand the tree for nextop_details, and change the type of lnk_b_retail from BigDecimal to int, just as we did for the Add operation.
  9. Change the direction of the nextop_details field to Output.

    In the application, the lnk_b_stockno field serves as an output field and is also the field in which the key identifying the required record is input. To handle this, we will now create an input interface field to accept the key.

  10. Drag lnk-b-stockno from the COBOL Entry Point pane to the Interface Fields pane and drop it onto the lnk_file_status interface field. This ensures that the new interface field is first on the list and thus the first field to supply its value to the program.
  11. Save the service interface.
Previous Topic Next topic Print topic