BookmarkSubscribeRSS Feed

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:

 

  1. Extend OPTION BOMFILE so that it is functional in text files included/updated in a ZIP file, too
  2. 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;

 

2 Comments
rhmthomson1
SAS Employee
Status changed to: Suggestion Under Review
 
Tom
Super User
Super User

Note will also need to fix ZIP engine so that it can recognize BOM in files when READING from a ZIP file.