Add JFY=(SHIFT=LEFT) in OUTREC BUILD to your card, But I don't think Bill would encourage two passes ( I guess it will) otherwise he could have suggested.
SORT FIELDS=COPY
INREC FINDREP=(STARTPOS=18,ENDPOS=28,
IN=(C' 0000000000',
C' 000000000',
C' 00000000',
C' 0000000',
C' 000000',
C' 00000',
C' 0000',
C' 000',
C' 00',
C' 0'),OUT=C' ')
I have indicated a space before the zeroes. So the zeroes in between will not be affected. Although I'm also expecting a better answer. Since vasanthz is correct that people with OCD will react on this one.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
boyti ko,
OK. The IFTHEN=(WHEN=(logicalexpression has one test per possible leading-zero pattern. You, currently, have that many tests for the first element of the FINDREP.
You can improve that slightly by including DO=1. DO should always be there when there a limit to the number of changes possible (other than the length specified or implied to the FINDREP).
However, the number of tests can't be limited when there are no leading zeros.
You'd also have to know if there were actual data following the field being FINDREPed.
Pandora-Box,
There are alphanumeric data items as well. Any leading blanks there would disappear with SQZ or JFY (better for this example).