Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to Split a given String

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

New User


Joined: 23 Jun 2005
Posts: 22

PostPosted: Tue Mar 21, 2006 12:40 am    Post subject: How to Split a given String
Reply with quote

hi i have a value clause

like 01 a pic x(100) value' name name1 name name1 .......' like that

i want to display name name1
name name 1
name name 1
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Mar 21, 2006 9:39 am    Post subject: Re: Split a given String.
Reply with quote

Quote:
like 01 a pic x(100) value' name name1 name name1 .......' like that

i want to display name name1
name name 1
name name 1

If "name name1" is a fixed length field, say 10. means you can have a max of 10 such sub sets in ur X(100) variable. Display it like...

Code:
DISPLAY A(1:10).
DISPLAY A(11:10).
DISPLAY A(21:10).
DISPLAY A(31:10).
DISPLAY A(41:10).
DISPLAY A(51:10).
DISPLAY A(61:10).
DISPLAY A(71:10).
DISPLAY A(81:10).
DISPLAY A(91:10).


Hope it helps...

Regards,
Priyesh.
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Tue Mar 21, 2006 11:13 am    Post subject: Re: Split a given String.
Reply with quote

Hi,
I think you can use the following statement...


PERFORM VARYING i FROM 1 BY 10 UNTIL (i >100)
DISPLAY a(i:10)
END PERFORM.


I hope i have answered your answer.

Cheers
RSC
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 Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us