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
 
Using Unstring command how to split the variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Using Unstring command how to split the variable
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    Post subject:
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    Post subject:
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: 8281
Location: Dubuque, Iowa, USA

PostPosted: Wed Sep 29, 2010 4:47 pm    Post subject:
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    Post subject:
Reply with quote

http://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    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 Need help with 002-030 ABEND in TSO R... Terry Tallian TSO/ISPF 0 Sat Mar 17, 2018 1:13 am
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts OUTREC with ALter Command scorp_rahul23 DFSORT/ICETOOL 1 Wed Nov 22, 2017 3:10 pm
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us