IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Suppression of trailing spaces in given string


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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: 8700
Location: Dubuque, Iowa, USA

PostPosted: Fri Mar 13, 2009 5:35 pm
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: 3156
Location: Tucson AZ

PostPosted: Fri Mar 13, 2009 6:47 pm
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 All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts To Unstring spaces in a field COBOL Programming 3
No new posts XML Generate - suppression of complex... COBOL Programming 0
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts how to complete the end of a record w... DFSORT/ICETOOL 2
No new posts ICETOOL to SUM String DFSORT/ICETOOL 1
Search our Forums:


Back to Top