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 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