07-08-2015 11:01 AM
My sas environment is set with global encoding UTF-8.
I want to export my SAS dataset into a UTF-16 encoded csv file to feed the file into another application. I was able to do this successfully. However, when I try to zip the UTF-16 encoded file(s) using ODS package, the encoding of the zipped files change automatically to ANSI.
Here is the macro i used for zipping:
options lrecl=10000 ;
ods package(test) open ;
filename fil1 "&_outbound./&file1." encoding="utf-16le";
ods package(test) add file=fil1;
filename fil2 "&_outbound./&file2." encoding="utf-16le";
ods package(test) add file=fil2;
ods package(test) publish archive properties(archive_name="zipfile.zip" archive_path="/home/loc" );
ods package(test) close clear;
I have verified that "&_outbound./&file1" is UTF-16. But the same file extracted from zipfile.zip archive is ANSI. Is there any option to set encoding here?
Thanks in advance!
02-28-2017 12:39 AM
Just to update on this topic- I had raised this issue to SAS tech Support but unfortunately did not recieve any useful solution.
My application has now migrated to SAS9.4. I did a quick search in SAS docs but couldnt find any major enhancements to ODS package in 9.4 (that could preserve the encoding type of the file).
If there are any thoughts, please let me know.