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
How can you get the ksds file records into your cobol program?
What is the difference between comp and comp-3?
Write a cobol program making use of the redefine clause.
IF I mention stop run in CICS what happens?
What are declaratives and what are their uses in cobol?
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
how to convert the recors form vsam file to db2 table tru file aid
Which Search verb is equivalent to PERFORM…VARYING?
In COBOL programming, what is PERFORM? What is VARYING?
What is amode(24)?
explain sorting techniques in cobol program?
What are various search techniques in cobol? Explain.
Why would you use find and get rather than to obtain?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
What are all the divisions of a COBOL program?