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:
- It checks the operation name by retrieving the content of the DFHWS-OPERATION container.
- If the returned operation name matches the name expected by the program (in this case,
reverserequest), the program:
- Populates the request data structure (in
REQ01.cpy) with the content of the DFHWS-DATA container.
- Populates the DFHWS-DATA container with the content of the response data structure (in
RESP01.cpy).
To provide the required operation logic, you must code it manually by editing the program.
- From the
Application Explorer, double-click
reverse.cbl to open it in the COBOL editor.
- 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.
- Scroll to the bottom of the program and add the following
COPY statement after the last
exit program. statement:
copy 'revLogic.cpy'.
- 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.
- Click
File > Save.
- Close the COBOL editor.
Eclipse automatically builds the project to include your changes.