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
Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
i want a program using by if, evaluate , string, unstring, perform, occurs?
What are different data types in cobol?
Explain the configuration section of a cobol program with examples of syntax.
In COBOL programming, what is PERFORM? What is VARYING?
What is the difference between next sentence and continue in cobol programing language?
What is the difference between PIC 9.99 and PIC9v99?
Can you please let me know the centre name of INS certification in Kolkata.
Why did you choose to work with ibm mainframe cobol programming?
Can we change the password using ALTER? anyone tried and changed?
Write down the divisions of cobol program?
How many sections are there in data division in COBOL?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
What are the different rules to perform a Search?