View previous topic :: View next topic |
Author |
Message |
priyam Beginner
Joined: 05 Jul 2006 Posts: 16 Topics: 12
|
Posted: Mon May 14, 2007 6:28 am Post subject: PL/1 Program to mirror a sentence |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Mon May 14, 2007 6:45 am Post subject: |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon May 14, 2007 7:01 am Post subject: |
|
|
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 |
|
 |
|
|