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

Using Unstring command how to split the variable


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sarav_viveka

New User


Joined: 18 Jan 2007
Posts: 2
Location: chennai

PostPosted: Tue Sep 28, 2010 1:59 pm
Reply with quote

The input text string has length of 200 must be broken down into text blocks of 40 characters . Each break of text must not be done in the middle of a word. If the last word does not fit into the end of the 40 character string, that word must be cut and then pasted into the start of the next 40 character string.

Total number of 40 character strings are to be calculated and sent to the output.
Each 40 character string must have a corresponding row number sent to the output.

Can you please tell me how to do it UNSTRING command
Back to top
View user's profile Send private message
balakrishna reddy.bala

New User


Joined: 15 Sep 2010
Posts: 17
Location: india

PostPosted: Tue Sep 28, 2010 2:48 pm
Reply with quote

Hi,

Did somebody challenged you to do it using unstring!! icon_neutral.gif

If not you can do it using reference modification.

Quote:

Each 40 character string must have a corresponding row number sent to the output.


you want to accommodate the row number as well in the 40 bytes??
Back to top
View user's profile Send private message
sarav_viveka

New User


Joined: 18 Jan 2007
Posts: 2
Location: chennai

PostPosted: Wed Sep 29, 2010 10:36 am
Reply with quote

i have to accommodate the row number as well as 40 bytes. But i wants to know How to check Each break of text must not be done in the middle of a word. If the last word does not fit into the end of the 40 character string, that word must be cut and then pasted into the start of the next 40 character string Using REFERENCE MODIFICATION
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Sep 29, 2010 4:47 pm
Reply with quote

Look at the 40th byte. If it is a space, move all 40 bytes. If it is not a space, go backwards to find the last space before the 40th byte. Move bytes 1 through wherever the space is, then start again from the character after the space.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Sep 29, 2010 6:55 pm
Reply with quote

ibmmainframes.com/viewtopic.php?t=45318&
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 RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
Search our Forums:

Back to Top