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
Difference between array and sub-script ?
What is static and dynamic call in cobol?
Difference between cobol and cobol-ii?
What is the LINKAGE SECTION used in COBOL?
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
What are the pertinent COBOL
What is the problem of ordered sequential files access?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
Can you please let me know the centre name of INS certification in Kolkata.
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
how do you reference the ksds vsam file formats from cobol programs
How you can read the file from bottom?
In COBOL programming, what is PERFORM? What is VARYING?
What is the difference between external and global variables in COBOL?