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
 
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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 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 How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm

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