Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8165
Location: East Dubuque, Illinois, USA

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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts String after '.' (period) is not copy... balaji81_k SYNCSORT 6 Wed Aug 23, 2017 9:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us