Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1230

SAS FILE and options RECFM=N encoding="utf-8 --> ENCODING option ignored for files opened with RECFM=N

$
0
0

I have code that composes XML from parts that are stored in a table in a database. I export XML via the FILE command with options RECFM=N so that CRLF characters do not appear at the end. XML is encoded in UTF-8, but sas in WLATIN2.

If I use the setting RECFM=N, then SAS prompts encoding = UTF=8. If I don't use UTF8 encoding, the XML contains invalid characters...

How to export XML in UTF8?

proc sql noprint;select distinct PROCESS_IDinto :g_processIDList separated by ''from out_lib.Dbn_xml_data;quit;%put &g_processIDList.;%macro DAR_XML_PROCESSING1;    %if %length(&g_processIDList.) ne 0 %then %do;        %do i=1 %to %sysfunc(countw(&g_processIDList., ''));                       %let l_processID=%scan(&g_processIDList.,&i,%str( ));            %put processing: &l_processID.;            data HELP;                set out_lib.DBN_XML_DATA (where=(PROCESS_ID = "&l_processID."));            run;            proc sort data=HELP out=HELP (keep=XML_CONTENT);            by PART_ID;            run;            filename out "\\somePath\&l_processID..xml" RECFM=N encoding="utf-8";            data _null_;              file OUT;              set HELP;              put XML_CONTENT;            run;        %end;       %end;    %else %do;        %put [NOTE]: nothing to process!!;    %end;%mend DAR_XML_PROCESSING1;%DAR_XML_PROCESSING1;

Viewing all articles
Browse latest Browse all 1230

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>