First of all, let me go on record as stating that, since I don't know much about this file or your processing, I think this would be better handled by something else, like an EDIT or a SORT program.
That being said, there's a couple of options you could look into. You'd start by reading a record from the input dataset. Let's call the variable holding the record
therec.
FILEA will be the unmatched output,
FILEB will be the matched output. Since you stated that the data you want to remove starts with a particular value, you can use the
LEFT function to examine the 6 leftmost bytes of the data:
If LEFT(therec,6) = 'AB1FGZ' Then ... write to FILEB
Else ... write to FILEA
You can use the
PARSE function:
PARSE VAR therec check 7 .
If check = 'AB1FGZ' Then ... write to FILEB
Else ... write to FILEA
You can use the
POS function:
If POS( 'AB1FGZ',therec) = 1 Then ... write to FILEB
Else ... write to FILEA