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

Combine columns without breaking words


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
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
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: 1565
Location: Andromeda Galaxy

PostPosted: Sat Mar 19, 2016 3:17 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Parsing more than 1000 columns in a s... SYNCSORT 10
No new posts Export columns from DB2 table with pi... DB2 14
No new posts position, start pos, length of column... SYNCSORT 14
No new posts Breaking a CICS enqueue? CICS 3
No new posts Query for fetching matching data in t... DB2 10
Search our Forums:

Back to Top