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: 8165
Location: East Dubuque, Illinois, 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 MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

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