Add Reverse Operation Logic

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

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

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

  1. From the Application Explorer view, double-click REVERSEJ.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.

    The provided revLogicJ.cpy copybook contains one perform statement that populates the request and response data structures. You need to include the copybook in the program and execute the perform statement.

  3. Between the EXEC CICS GET and the EXEC CICS PUT statements, replace the comment code (******* ...) with:
    perform reverse-logic
  4. Scroll down to the bottom of the program, and add the following copy statement after the exit program statement:
    copy 'revLogicJ.cpy'.
  5. Click File > Save.
  6. Close the COBOL editor.

    Eclipse automatically builds the project to include your changes.