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
 
breaking string on basis of spaces

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
scorp_rahul22
Currently Banned

New User


Joined: 06 Aug 2007
Posts: 42
Location: chennai

PostPosted: Tue Apr 29, 2008 11:47 am    Post subject: breaking string on basis of spaces
Reply with quote

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
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Tue Apr 29, 2008 11:56 am    Post subject: Reply to: breaking string on basis of spaces
Reply with quote

yes
http://catb.org/~esr/faqs/smart-questions.html
Back to top
View user's profile Send private message
scorp_rahul22
Currently Banned

New User


Joined: 06 Aug 2007
Posts: 42
Location: chennai

PostPosted: Tue Apr 29, 2008 12:00 pm    Post subject: Reply to: breaking string on basis of spaces
Reply with quote

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
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Tue Apr 29, 2008 12:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
scorp_rahul22
Currently Banned

New User


Joined: 06 Aug 2007
Posts: 42
Location: chennai

PostPosted: Tue Apr 29, 2008 7:09 pm    Post subject: Reply to: breaking string on basis of spaces
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Apr 29, 2008 7:33 pm    Post subject:
Reply with quote

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