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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

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