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

String Manipulation using COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Deepak Dash

New User


Joined: 03 Sep 2007
Posts: 16
Location: India

PostPosted: Thu Nov 26, 2009 7:39 pm
Reply with quote

Hi All,

I have seen few examples in this forum how to TRIM leading and Trailing spaces for a string in COBOL. Just want to know if there is a way to do the both for a string with a simple logic.

ws-string1 pic X(30) value ' cobol book '.

what I need is only 'cobol book' in my output string.

Is there a way? Appriciate your help.
Back to top
View user's profile Send private message
Deepak Dash

New User


Joined: 03 Sep 2007
Posts: 16
Location: India

PostPosted: Thu Nov 26, 2009 8:21 pm
Reply with quote

Or I want to ask this question in another way like, How do I count the number of words that i have in my string?

Thanks.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Nov 27, 2009 2:53 am
Reply with quote

Hello,

At the top of the page is a link to "IBM Manuals". Near the top is the COBOL Language Reference. Look here for info about UNSTRING which will answer your question.

If you find something in the manual that is not clear, post what you found and your doubt - someone will be able to clarify.
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 COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top