Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Suppression of trailing spaces in given string

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

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Fri Mar 13, 2009 4:23 pm    Post subject: Suppression of trailing spaces in given string
Reply with quote

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
View user's profile Send private message

himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Fri Mar 13, 2009 4:29 pm    Post subject:
Reply with quote

What is the o/p you are looking out for?
Back to top
View user's profile Send private message
shell100

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Fri Mar 13, 2009 4:31 pm    Post subject: Reply to: Suppression of trailing spaces in given string
Reply with quote

I am expecting OUTPUT as "My Name is XYZ"
Back to top
View user's profile Send private message
shell100

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Fri Mar 13, 2009 4:33 pm    Post subject: Reply to: Suppression of trailing spaces in given string
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Fri Mar 13, 2009 4:51 pm    Post subject:
Reply with quote

One way of doing this through cobol pgm is by inspect with replace verb.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7992
Location: Bellevue, IA

PostPosted: Fri Mar 13, 2009 5:35 pm    Post subject:
Reply with quote

OCCURS DEPENDING ON
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Mar 13, 2009 6:47 pm    Post subject: Re: Suppression of trailing spaces in given string
Reply with quote

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
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 Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us