Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need a program to reverse the string from a Sentence

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sudhaaa

New User


Joined: 24 Mar 2005
Posts: 51

PostPosted: Wed May 11, 2005 12:06 pm    Post subject: Need a program to reverse the string from a Sentence
Reply with quote

Hi,

I have a array of strings form a Sentence.Need a program to reverse the words.
Back to top
View user's profile Send private message

vasanthanc

New User


Joined: 01 Apr 2005
Posts: 58

PostPosted: Wed May 11, 2005 12:47 pm    Post subject:
Reply with quote

You can use the REVERSE key word to reverse characters in a word. To reverse the whole sentence also you can use the same. But if you want to keep the words as whole, then you can use the following code

for i = 1 to no-of-words
move old-sentance(n - i + 1) to new-sentance(i)
end-for

where as old-sentance and new-sentance are arrays, in which each array elament have single word and no-of-words have the total no of words in the sentance

Hope this will help you
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Error executing Java program in OSGI ... danik56 CICS 0 Thu Apr 26, 2018 12:16 am
No new posts How to display offset thru cobol prog... tvinodkumar7 CICS 2 Sun Apr 22, 2018 8:42 pm
No new posts How do you attach a DB2 plan to a CIC... John Poulakos DB2 0 Wed Apr 18, 2018 1:49 am
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts Mantis Program Compiled? luis carlos CICS 2 Sat Apr 07, 2018 8:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us