Outrec When match with spaces.
Posted: Mon Aug 11, 2014 11:16 pm
Very new to Syncsort. I have only ever used it to just sort a file by a few fields. I am just piecing together code I have found on this forum and on the web. It is basically de-duping a file and adding a code depending on the region the record is in. But I want to make it match the whole field.
This code works just fine if I just match on the first 4 characters of the field without any spaces.
But if I want to match on 'WEST REGION' which has a space in it I get a syntax error on the outrec statement.
What do I need to do to make it match the whole field regardless of spaces in it?
This code works just fine if I just match on the first 4 characters of the field without any spaces.
SORT FIELDS=(091,15,CH,A,171,20,CH,A)
SUM FIELDS=NONE
OUTREC IFTHEN=(WHEN=(171,4,CH,EQ,C'WEST'),OVERLAY=(740:C'1')), -
IFTHEN=(WHEN=NONE,OVERLAY=(740:C'2'))
SUM FIELDS=NONE
OUTREC IFTHEN=(WHEN=(171,4,CH,EQ,C'WEST'),OVERLAY=(740:C'1')), -
IFTHEN=(WHEN=NONE,OVERLAY=(740:C'2'))
But if I want to match on 'WEST REGION' which has a space in it I get a syntax error on the outrec statement.
SORT FIELDS=(091,15,CH,A,171,20,CH,A)
SUM FIELDS=NONE
OUTREC IFTHEN=(WHEN=(171,11,CH,EQ,C'WEST REGION'),OVERLAY=(740:C'1')), -
IFTHEN=(WHEN=NONE,OVERLAY=(740:C'2'))
SUM FIELDS=NONE
OUTREC IFTHEN=(WHEN=(171,11,CH,EQ,C'WEST REGION'),OVERLAY=(740:C'1')), -
IFTHEN=(WHEN=NONE,OVERLAY=(740:C'2'))
What do I need to do to make it match the whole field regardless of spaces in it?