how we can reverse the string in the cobol for example
satheesh can be reveresed as hseehtas
Answer Posted / paul
DATA DIVISION.
WORKING-STORAGE SECTION.
01 I PIC 9.
01 J PIC 9.
01 ST1 PIC X(5).
01 ST2 PIC X(5).
PROCEDURE DIVISION.
MOVE 1 TO I.
MOVE 'KOTI' TO ST1.
PARA-A.
PERFORM PARA-B VARYING J FROM 5 BY -1 UNTIL J = 0.
DISPLAY 'STRING REVERSE' ST2.
STOP RUN.
PARA-B.
MOVE ST1(I:1) TO ST2(J:1).
ADD 1 TO I.
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Explain how you can characterize tables in cobol?
how do you reference the printer file formats from cobol programs
What are the different data types in cobol?
how to refer the data field?
I have a File that has duplicate records. I need only those records that occur more than thrice.?
How do you differentiate between cobol and cobol-ii?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
Discuss about changing dataset name in proc.
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
what happens if parmparameter passes zero bytes to the program
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
Difference between cobol and cobol-ii?
What is the Purpose of Pointer in the string?