MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PL/1 Program to mirror a sentence

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
priyam
Beginner


Joined: 05 Jul 2006
Posts: 16
Topics: 12

PostPosted: Mon May 14, 2007 6:28 am    Post subject: PL/1 Program to mirror a sentence Reply with quote

Hi,

Am new to PL/1.Am just learning. I want a PL/1 program to mirror a sentence.

Input:

GOD IS LOVE.

Output should be:

.EVOL SI DOG

I have tried using the SUBSTR and ARRAY.I got half of the output.But, while writing the OUTPUT using PUT each character is printing seperately.
Kindly help me in this.
Thanks in advance
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Mon May 14, 2007 6:45 am    Post subject: Reply with quote

priyam,

1. click on "Quick manuals" on top of this page
2. click on "Enterprise PL/I Language Reference" link under PLI
3. scroll to section 19.199 and read about "Reverse"

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon May 14, 2007 7:01 am    Post subject: Reply with quote

However, you need the version 3 compiler. If you are using version 2 then you can use an array but better is to use TRANSLATE (for short strings anyway). Also, as you found, PUT skips to next line after printing. You can concatenate (||) variables in one PUT statement : PUT SKIP LIST(var1||var2||); etc.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group