View previous topic :: View next topic
|
Author |
Message |
shell100
New User
Joined: 14 Apr 2006 Posts: 25 Location: Banglore,India
|
|
|
|
Hi,
I have a given string as “ My Name is XYA “ & need to suppress only trailing spaces given at the end. Is there any cobol function available for it ?
Thanks in advance |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
What is the o/p you are looking out for? |
|
Back to top |
|
|
shell100
New User
Joined: 14 Apr 2006 Posts: 25 Location: Banglore,India
|
|
|
|
I am expecting OUTPUT as "My Name is XYZ" |
|
Back to top |
|
|
shell100
New User
Joined: 14 Apr 2006 Posts: 25 Location: Banglore,India
|
|
|
|
Let say input is "My Name is XYZ________".
____ are the spaces in the string at the end which i want to suppress giving output as "My Name is XYZ". |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
One way of doing this through cobol pgm is by inspect with replace verb. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
OCCURS DEPENDING ON |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
shell100 wrote: |
I have a given string as “ My Name is XYA “ & need to suppress only trailing spaces given at the end. Is there any cobol function available for it ? |
Why does your expected output also have the leading space suppressed?
What would you have the suppressed spaces replaced with?
How will you know that the spaces were suppressed? |
|
Back to top |
|
|
|