I want to test a field using the following validation pattern :
- first position should be '+' or numeric
- all other positions should be numeric or spaces. If this is not the case, all positions within the field should become spaces.
Furthermore, in the output record, the field should be squeezed to the left and remain 10 positions (trailing blanks).
Syncsort version used = 1.3.2.1R
Input record consists of a five position key (which has to be kept), a ten position field (for which the conditions as described above should apply) and a five position field (which has to be kept).
Example input record :
key011234567890aaaaa
key02123 56 8 aaaaa
key03123a56b890aaaaa
key04+555555555aaaaa
key05 5aaaaa
key06 aaaaa
key07+23a56b890aaaaa
key02123 56 8 aaaaa
key03123a56b890aaaaa
key04+555555555aaaaa
key05 5aaaaa
key06 aaaaa
key07+23a56b890aaaaa
Desired output record :
key011234567890aaaaa
key02123568 aaaaa
key03 aaaaa
key04+555555555aaaaa
key055 aaaaa
key06 aaaaa
key07 aaaaa
key02123568 aaaaa
key03 aaaaa
key04+555555555aaaaa
key055 aaaaa
key06 aaaaa
key07 aaaaa
I have tried a number of combinations using PARSE and SQZ, but none with the desired results. Any suggestions?
Thanks in advance!