Add Operation Logic to reverse.cbl

Guides you through the process of adding logic to the Reverse application that performs the task of reversing input.

The generated skeleton program, reverse.cbl, contains some basic functionality that is common to any CICS Web service that uses the Channel interface, such as:

To provide the required operation logic, you must code it manually by editing the program.

  1. From the Application Explorer, double-click reverse.cbl to open it in the COBOL editor.
  2. Declare the following two variables in the working-storage section:
    01 ws-string-len               pic x(4) comp-5.
    01 ws-reversedString-len       pic x(4) comp-5.
  3. Scroll to the bottom of the program and add the following COPY statement after the last exit program. statement:
    copy 'revLogic.cpy'.
  4. Scroll up to the WS-OP-1 paragraph, and add the following PERFORM statement between the EXEC CICS GET and the EXEC CICS PUT statements:
    Perform reverse-logic
    Note: reverse.cbl contains two comment lines between the two EXEC CICS statements. You can place your PERFORM statement between the comment lines.
  5. Click File > Save.
  6. Close the COBOL editor.

    Eclipse automatically builds the project to include your changes.