Please note that one field can have any number of single spaces in between or cannot have even a single space in between.
For ex,
Code:
A B CDE FGHI KDJFJ D S
ABCDEFGRHYSJFDJFKJFK
SFDHDSFSD ASDSD GFG
In the above I/P, respective field of the first record has 6 single spaces in between and 2nd record does not have any spaces and the third has 2 spaces so on...
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
ksk wrote:
Can you please explain what the below code does?
The First C'bb' is looking for 2 adjacent spaces(b= blank) and eliminating them. so if there are even number of space at the end they would get all eliminated and the other conditions are checking for odd number of spaces and starting spaces for field 2.
You are fine as long as your field 1 has single spaced words. It doesn't matter how many words you have.
however if your data has
Code:
ABC FH <== 2 adjacent spaces between ABC and FH
Your output would be
Code:
ABCFH
So as long as you maintain single spacing between words you are fine.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from: