COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'

Answer Posted / meghraj hulawale

Data Division.
w-s-s.
77 str pic x (6) value 'BOMBAY'.
77 revstr pic x (6).
77 I pic 9 (1).
77 J pic 9 (1) value 1.
77 cnt pic 9 (1).
Procedure Division.
inspect str tallying cnt for all characters before initial space.
move cnt to I.
perform until I < 1
move str (I:1) to revstr (J:1)
add 1 to J
subtract 1 from I
end-perform.
Display revstr.
stop run.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different rules of SORT operation?

689


Explain the configuration section of a cobol program with examples of syntax.

646


How to remove 2 duplicate records and copy only one using job control language?

727


What are 77 levels used for?

648


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.

1691






how do you reference the rrds file formats from cobol programs

783


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

846


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1513


Which Search verb is equivalent to PERFORM…VARYING?

672


What is the LINKAGE SECTION used in COBOL?

881


Define static linking and dynamic linking.

652


What is the difference between binary search and sequential search?

631


What do you understand by psb and acb?

659


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

693


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

919