by BillyBoyo » Fri Aug 26, 2011 3:14 pm
Well, I'm sorry, I've tried twice already. I don't think you'll find what you want in the manual, but I can't check for you as I don't have a SyncSORT manual. I don't think it will be there, because it is not a common thing to do for a piece of data. Only things I've ever centred are headings. That, you can probably do in SyncSORT, but I can't check (see earlier point).
To centre a field, you'd need to know the length of the field itself, and the length of the data (presumably variable per record). At this stage, I think, with nothing built-in, it would get tricky with a SORT.
If your data is fixed, then the centreing has been easy all along. You know how much space to leave at the left, and the right, and put your field in the middle.
If you really want to do it with SORT, you have to work out beforehand the spacing for treating each of the possible lengths of your field as a fixed-length item.
If your field is 10 bytes and you want to centre it in 10, then
10 bytes long, 0 left, 0 right, displacement in field 0.
9 bytes long, 1 left, 0 right, displacement in field 1.
8 bytes long, 1 left, 1 right, dispalcement in field 1.
7 bytes long. 2 left. 1 right, displacement in field 2.
etc
The field has to be relocated to start at the displacement. The left and right lengths have to be set to blank.
The size of your fields dictates how tedious and error-prone this is to code out. I suppose once it is done, it is done. If you go that way, please post back your solution, as it might help others.