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

How to Split a given String


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1448
Location: Chicago, IL

PostPosted: Tue Mar 21, 2006 9:39 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts file manager is doing string conversion IBM Tools 3
Search our Forums:

Back to Top