View previous topic :: View next topic
|
Author |
Message |
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
I want to parse string from input file
INPUT FILE (VARIABLE LENGTH)
-----------------------------------------
a b c d e fg hikl
OUTPUT
---------
I need to break above line into number of lines whenever space is encountered.(It can be one space as well as many spaces)
I want output as
a
b
c
d
e
fg
hikl
I want to know is this possible in COBOL |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
can u please paste that thing here if possible, as i am not able to open that page because of access issues |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi Rahul Gupta !
Perhaps, if you reflect on the way, you posted your questions, you could come to the conclusion, why you're getting short and single-line answers.
A shade more gentleness would be indicated.
So now, back to your problem.
Use UNSTRING command. Design a little loop, where you unstring the first string delimeted by space and the rest into two variables. Move back only the rest. Unstring again.
Regards, UmeySan |
|
Back to top |
|
|
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
I am not able to get logic for that. It wud be very kind of you if u can help me in that |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Post what you have tried and where there are questions or problems.
If you have no idea where to start, i suggest you look in the COBOL Language Refverence and Programmers Guide available via the "IBM Manuals" link at the top of the page. There is a lot of material on UNSTRING as well as examples.
If you read something you do not understand, post it here and we will try to clarify. |
|
Back to top |
|
|
|