Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Combine columns without breaking words

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Sat Mar 19, 2016 9:33 am    Post subject: Combine columns without breaking words
Reply with quote

I have flat file of 500 bytes fixed length. This file contains 5 address lines each of 60 bytes.

My requirement is to combine the address lines by removing unwanted spaces so that the address appears continously as much as possible. The basic intention is to fit in as many characters as possible in each address line (60 byte maximum). The catch is however there should not be any words which should break.

For eg.

Address line 1 - Lane number 56
Address line 2 - Villa number 12345
Address line 3 - Florida United States of America

Output should be

Address line 1 - Lane number 56 Villa number 12345 Florida United States of
Address line 2 - America
Address line 3 - This line should be blanked out

I have used the SQZ operator with MID option but I am not sure how to handle the part of not breaking the word.

Thanks
Indrajit
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Sat Mar 19, 2016 3:17 pm    Post subject:
Reply with quote

It is better to handle this using COBOL rather than SYNCSORT
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts 3 columns update Seppe DB2 2 Mon Jun 22, 2015 6:43 pm
No new posts Splitting of the text without affecti... mkk157 DFSORT/ICETOOL 4 Wed Feb 18, 2015 6:10 pm
No new posts SPANNED loads for XML/LOB columns Manoj Bhaskaran DB2 2 Thu Jan 01, 2015 9:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us