Hi,
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:
%macro test;
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;
%mend;
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!
Hi:
I think this is a question for Tech Support. To open a track with Tech Support, follow the instructions here: Technical Support Form
cynthia
Thanks Cynthia, i shall do as you suggested.
Hi All,
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.
Thanks,
Dilip
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.