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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.