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
What is the difference between next sentence and continue in cobol programing language?
What is the difference between structured cobol programming and object alternativelyiented cobol?
What rules are to be followed while using the corresponding options?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
What is amode(31)
Discuss about changing dataset name in proc.
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
what is amode(24), amode(31), rmode(24) and rmode(any)?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
what are decleratives in cobol?
how to move the records from file to array table. give with code example
Give some examples of command terminators?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there