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 to remove the spaces at the end of each record in the output file of variable length, via cobol program?
What is link edit in cobol?
what is the use of outrecord?
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
Difference between cobol and cobol-ii?
What are the different types of condition in cobol and write their forms.
Write some characteristics of cobol as means of business language.
how do you reference the variable block file formats from cobol programs
HOw can I get the negative sign while deduct high value from low value
Name the divisions, which are available in a cobol program?
Write a cobol program making use of the redefine clause.
i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
What is cobol?
how can i see junk values in dclgen or in hostvariable of comp ?