SELECT myFile LOCATE lcOutput = ALLTRIM(email) SKIP SCAN REST lcOutput = lcOutput + "," + ALLTRIM(email) ENDSCAN =STRTOFILE(lcOutput,"myoutputfile")