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 are different data types in cobol?
how to refer the data field?
How do you get the data to code the BMS macro?
When is inspect verb is used in cobol?
Describe the cobol database components?
What is a scope terminator give example?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
What is the LINKAGE SECTION used in COBOL?
A table has two indexes defined. Which one will be used by the SEARCH?
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
how to access the file from prodution from changeman tool and to submit a file to production
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
how do you reference the variable unblock file formats from cobol programs
What is the problem of ordered sequential files access?