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


Please Help Members By Posting Answers For Below Questions

Define cobol?

875


how to convert the recors form vsam file to db2 table tru file aid

2767


What is the default value(s) for an initialize and what keyword allows for an override of the default?

702


Difference between cobol and cobol-ii?

719


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

1482






Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

1709


What is the difference between a binary search and a sequential search what are the pertinent cobol?

744


What kind of error is trapped by on size error option?

749


What is the problem of ordered sequential files access?

708


What are the different open modes available in cobol?

726


Explain about different table spaces.

654


Difference between array and sub-script ?

1171


How many bytes S(8) comp field occupy and its maximum value?

1644


Which is not true about evaluate statement

1630


What is the usage of comp fields in cobol?

664