COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'
Answer Posted / sushree
id division.
prog-id. hello.
data division.
working-storage section.
01 ws-str pic A(6) value 'BOMBAY'.
01 ws-cnt pic 9(1).
01 ws-str1 pic A(1).
01 ws-str2 pic A(6) value space.
procedure division.
inspect ws-str tallying ws-cnt for all characters
display ws-cnt
perform until ws-cnt < 1
move ws-str3(ws-cnt:1) to ws-str1
string ws-str2 delimited by space
ws-str1 delimited by size
into ws-str3
compute ws-cnt = ws-cnt - 1
end-perform.
display ws-str3.
stop run.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
How do you differentiate between cobol and cobol-ii?
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
How do you reference the fixed block file formats from cobol programs
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc
Write the code implementing the perform … varying.
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
How arrays can be defined in COBOL?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
What are the different data types in cobol?
What kind of error is trapped by on size error option?
What are declaratives and what are their uses in cobol?
How to know whether the module is dynamical or statistical?
what happens if parmparameter passes zero bytes to the program
What is the utilization of copybook in cobol?