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
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
What is the difference between comp and comp-3?
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.
) How do u handle errors in BMS macro?
i want a program using by if, evaluate , string, unstring, perform, occurs?
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?
how can i see junk values in dclgen or in hostvariable of comp ?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
In which area will you utilize 88 level items in cobol?
Write the code to count the sum of n natural numbers.
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)?
What is comp-1 and comp-2?
how to move the records from file to array table. give with code example