how we can reverse the string in the cobol for example
satheesh can be reveresed as hseehtas

Answer Posted / adarsh

This can be achieved using
1. FUNCTION REVERSE - RECOMMENDED
2. REFERENCE MODIFICATION
.

1. MOVE FUNCTION REVERSE(WS-NAME-INPT) TO
WS-NAME-RVRS.

2. MOVE WS-NAME-INPT(1:1) TO WS-NAME-RVRS(8:1)
MOVE WS-NAME-INPT(2:1) TO WS-NAME-RVRS(7:1)
MOVE WS-NAME-INPT(3:1) TO WS-NAME-RVRS(6:1)
MOVE WS-NAME-INPT(4:1) TO WS-NAME-RVRS(5:1)
MOVE WS-NAME-INPT(5:1) TO WS-NAME-RVRS(4:1)
MOVE WS-NAME-INPT(6:1) TO WS-NAME-RVRS(3:1)
MOVE WS-NAME-INPT(7:1) TO WS-NAME-RVRS(2:1)
MOVE WS-NAME-INPT(8:1) TO WS-NAME-RVRS(1:1).

Is This Answer Correct ?    19 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you get the ksds file records into your cobol program?

644


What is the difference between comp and comp-3?

704


Write a cobol program making use of the redefine clause.

739


IF I mention stop run in CICS what happens?

1898


What are declaratives and what are their uses in cobol?

714






How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

1005


how to convert the recors form vsam file to db2 table tru file aid

2763


Which Search verb is equivalent to PERFORM…VARYING?

688


In COBOL programming, what is PERFORM? What is VARYING?

672


What is amode(24)?

684


explain sorting techniques in cobol program?

692


What are various search techniques in cobol? Explain.

650


Why would you use find and get rather than to obtain?

692


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

691


What are all the divisions of a COBOL program?

666