OPTION BOMFILE; is not being honoured when the text file (DAT, CSV, TXT, etc.) is included/updated in a ZIP file. I have two suggestions:
- Extend OPTION BOMFILE so that it is functional in text files included/updated in a ZIP file, too
- Or at least, please update the SAS Documentation at both FILENAME ZIP and BOMFILE to let users know that BOM cannot be added in case the text file is included/updated in a ZIP file, and suggest a workaround like :
/* OPTIONS BOMFILE; Not honoured within a ZIP file */
%let path= <<define path here>> ;
filename foo ZIP "&path./testzip_bom_u8.zip" ENCODING='utf-8';
data _null_;
file foo(shoes);
set sashelp.shoes;
IF _N_ = 1 THEN PUT ‘EFBBBF’x @; /* This adds the BOM to the beginning of the first record */
put region $25. product $14.;
run;