How to display string in the reverse order using occurs
clause?
Answer Posted / fool
both r foolish programmers...heres the working code..
identification division.
program-id pg1.
environment division.
data division.
working-storage section.
01 j pic 99.
01 i pic 99.
01 s1 pic a(15).
01 s2 redefines s1.
02 instr pic a(1) occurs 15 times.
01 s3 pic a(15).
01 s4 redefines s3.
02 outstr pic a(1) occurs 15 times.
procedure division.
p1.
display "Enter the string ".
accept s1.
perform p3 varying i from 15 by -1 until i = 0.
display "Reverse string ".
display s4.
stop run.
p3.
compute j = 15 - i + 1.
move instr(i) to outstr(j).
Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
Discuss about changing dataset name in proc.
Can we change the password using ALTER? anyone tried and changed?
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.
What is a SSRANGE and NOSSRANGE?
What are the different rules of SORT operation?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
What is the difference between next sentence and continue in cobol programing language?
State the various causes of s0c1, s0c5 and s0c7.
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
What is the Purpose of POINTER Phrase in STRING command in COBOL?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
HOw can I get the negative sign while deduct high value from low value
What is report-item in COBOL?
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?