Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
how to break a line using unstring verb

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 13
Location: Chennai

PostPosted: Mon Jun 09, 2008 5:21 pm    Post subject: how to break a line using unstring verb
Reply with quote

I want to break line using unstring operation whenever space is encountered and write that into the file.

I know unstring operation but my issue is whether we can use array for doing unstring operation.

suppose input line is like


Code:

first   second    third    fourth    fifth    sixth  ........................n


It can have n number of parts after breaking up so , I cant hardcore the variables

Can we get output like
Code:

first
second
third
fourth
fifth
sixth
....
....
....
n



Can someone guide on this
Back to top
View user's profile Send private message
References
ashimer

Senior Member


Joined: 13 Feb 2004
Posts: 360
Location: Bangalore

PostPosted: Mon Jun 09, 2008 5:52 pm    Post subject:
Reply with quote

rahul,

c this post ..

http://www.ibmmainframes.com/viewtopic.php?t=18150&start=0&postdays=0&postorder=asc&highlight=&sid=02524b4dd1ef003b8651de00b1a95293
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 13
Location: Chennai

PostPosted: Tue Jun 10, 2008 10:57 am    Post subject: Reply to: how to break a line using unstring verb
Reply with quote

I have used that code and its not working

Code:


PERFORM VARYING WS-SUB2 FROM 1 BY 1         
                UNTIL WS-UNTIL-OVER-SW = 'Y'
DISPLAY 'LIMIT IN ' WS-UNTIL-OVER-SW       
DISPLAY 'POINTER IN ' WS-POINTER           
UNSTRING VARLENREC DELIMITED BY ALL SPACES 
      INTO WS-DELIMITED-PATTERN-NEW(WS-SUB2)
      WITH  POINTER WS-POINTER             
   ON OVERFLOW                             
     DISPLAY 'OVERFLOW ' WS-POINTER         
     MOVE  'Y' TO WS-UNTIL-OVER-SW         
END-UNSTRING                               



I have infile having only one record

Code:

first   second    third    fourth    fifth    sixth


and i want to unstring this only as of now
and i am using the above logic
but its showing SOC7, when it reaches unstring word
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 13
Location: Chennai

PostPosted: Tue Jun 10, 2008 11:53 am    Post subject: Reply to: how to break a line using unstring verb
Reply with quote

It is always going in overflow condition
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1