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


Please Help Members By Posting Answers For Below Questions

What are different data types in cobol?

678


how to refer the data field?

1793


How do you get the data to code the BMS macro?

1470


When is inspect verb is used in cobol?

668


Describe the cobol database components?

672






What is a scope terminator give example?

650


how we sort two input files based on a common column and giving one o/p file please send me the coding logic?

1639


What is the LINKAGE SECTION used in COBOL?

883


A table has two indexes defined. Which one will be used by the SEARCH?

748


which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad

1014


how to access the file from prodution from changeman tool and to submit a file to production

6663


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1895


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?

687


how do you reference the variable unblock file formats from cobol programs

734


What is the problem of ordered sequential files access?

690