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
 
To get substring of a string including spaces

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

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Thu Oct 08, 2009 9:25 am    Post subject: To get substring of a string including spaces
Reply with quote

Hi

I have a string which is of cretain length with embedded spaces. I have to take the first 11 characters.

Eg. Input - Program Analysis --> output should be - Program Ana

Can u pls suggest how to do this
Back to top
View user's profile Send private message

Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Oct 08, 2009 9:34 am    Post subject:
Reply with quote

See reference modification in the Language Reference Manual.
Back to top
View user's profile Send private message
narasimha.g

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Thu Oct 08, 2009 10:01 am    Post subject: Reply to: To get substring of a string including spaces
Reply with quote

Hi

Im very new to this forum.. can u please give me the link of the manual
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Oct 08, 2009 10:04 am    Post subject:
Reply with quote

Click IBM Manuals at the top of the screen.
Back to top
View user's profile Send private message
narasimha.g

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Thu Oct 08, 2009 10:12 am    Post subject: Reply to: To get substring of a string including spaces
Reply with quote

I used referance modification as shown below.

MOVE WS-STRING (1:11) TO WS-SUB-STRING

where WS-STRING = program mn454

but the o/p was WS-SUB-STRING = MN4

can u pls help me in solving this.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Oct 08, 2009 10:16 am    Post subject:
Reply with quote

In order for us to help, you need to copy/paste the exact field definitions and all relevant code. Add a display statement to show the contents of WS-SUB-STRING after the MOVE.
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 Removing spaces before the tab character V S Amarendra Reddy SYNCSORT 1 Thu Jun 14, 2018 8:45 am
No new posts Remove all Parenthetical Statements -... JayaprakashT DB2 2 Fri Apr 27, 2018 3:57 am
No new posts Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm

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