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: 8697
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts file manager is doing string conversion IBM Tools 3
Search our Forums:

Back to Top