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 the difference is between continue and next sentence?
What is amode(31)
what happens if parmparameter passes zero bytes to the program
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
Write some characteristics of cobol as means of business language.
here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?
how do you reference the ksds vsam file formats from cobol programs
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
Write down the divisions of cobol program?
How you can characterize tables in cobol?
how do you reference the variable block file formats from cobol programs
What are the access modes of START statement?
What are 77 levels used for?
How to use the same COBOL program in Batch and CICS on lines? explain with an example
How do get the result of your program directly on your pc?