Page 2 of 2

Re: How to remove trailing Spaces in Syncsort?

PostPosted: Wed Mar 07, 2012 12:52 am
by BillyBoyo
How about just squeezing the first parsed field, ENDBEFR the "pipe"? The rest of the record can just be a normal definition, 11,70 for instance.

pjagathis, can you be very exact about your data, please. Can there be multiple blanks between elements of the first field, for instance?

Re: How to remove trailing Spaces in Syncsort?

PostPosted: Wed Mar 07, 2012 2:38 pm
by pjagathis
Yes BillyBoyo.

My field have multiple blanks between the fields and each blank will have length 1 byte only.

Re: How to remove trailing Spaces in Syncsort?

PostPosted: Thu Mar 08, 2012 12:30 pm
by pjagathis
Hi mfrookie,

Above code replaces spaces in all fields. But i need to remove the spaces only in first field. In the above code if my input is as below then,

W 6 5 4   |Z|111| 
W9        | | 11| 
W96653400 | |11 | 
W966 34000| |1 1| 
W9665 44  | |   | 


Then the output will be,

---+----1----+---
*****************
W 6 5 4|Z|111|   
W9|| 11|         
W96653400||11|   
W966 34000||1 1|
W9665 44|||     


But the expected output will be as below,

----+----1----+----
*******************
W 6 5 4|Z|111|     
W9| | 11|         
W96653400| |11 |   
W966 34000| |1 1| 
W9665 44| |   |   



Please advice me..!

Thanks for your help..!

Re: How to remove trailing Spaces in Syncsort?

PostPosted: Thu Mar 08, 2012 9:33 pm
by BillyBoyo
I don't have Syncsort, so I can't try this.

PARSE=(%00=(ENDAT=C'|',FIXLEN=11)),
...
BUILD=(%00,SQZ=(SHIFT=LEFT,MID=C' '),12,68)

If you try something like that, do you get something like what you want?

If your input is fixed-length and you get a problem with output being variable-length, try the affect of IFOUTLEN=n where n is your fixed-length.