COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'
Answer Posted / rashi
MOVE 'BOMBAY' TO WS-STRING.
INSPECT WS-STRING TALLYING WS-COUNT FOR ALL CHARACTERS
MOVE WS-COUNT TO WS-COUNT1.
MOVE 1 TO WS-COUNT2.
PERFORM VARYING WS-COUNT1 BY -1 UNTIL WS-COUNT1 = 0
MOVE WS-STRING(WS-COUNT1:1) TO WS-REV-STRING(WS-COUNT2:1)
ADD 1 TO WS-COUNT2
END-PERFORM.
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
What is rmode(24)
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
Which mode is used to operate the sequential file?
Describe the cobol database components?
How do you differentiate between cobol and cobol-ii?
In COBOL, what is the different between index and subscript?
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
What are literals?
Explain the configuration section of a cobol program with examples of syntax.
How you can read the file from bottom?
Write the code to count the sum of n natural numbers.
What is report-item in COBOL?
What is the compute verb? How is it used?
What is perform what is varying?