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
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
What is a scope terminator give example?
How do you differentiate between cobol and cobol-ii?
What rules are followed by the search verb.
State the various causes of s0c1, s0c5 and s0c7.
HOw can I get the negative sign while deduct high value from low value
How to remove 2 duplicate records and copy only one using job control language?
How many sections are there in data division in COBOL?
What is rmode(any) ?
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
When is inspect verb is used in cobol?
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
What are the different rules to perform a Search?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)