我无法在下面的Txt输出中使用右箭头(U + 2192)。
data _null_;
set WORK.CLASS nobs=nobs end=eof;
file '&outpath.\test.txt' dlm=',';
If _N_=1 then Put "&name.";
Put (_all_)(+0);
if eof then do;
Put "(here should be the right arrow) $$ here is a lot of text$$";
end;
run;
答案 0 :(得分:0)
您可以使用unicode
功能(如@richard提及),例如如下:
有关详细信息,请参阅documentation。另请注意,由于使用单引号,文件语句中的宏变量无法解析。请尝试以下方法:
data _null_;
set WORK.CLASS nobs=nobs end=eof;
file "&outpath.\test.txt" dlm=',';
If _N_=1 then Put "&name.";
Put (_all_)(+0);
if eof then do;
Put "%sysfunc(unicode(\u2192)) $$ here is a lot of text$$";
end;
run;
答案 1 :(得分:0)
有趣的角色。如果将其写入SAS日志,似乎会造成很多麻烦。工作一次然后导致异常,至少使用SAS 9.4(TS1M3 MBCS3170)。
NOTE: AUTOEXEC processing completed.
1
2 data _null_;
3 putlog 'Here is an arrow ' "%sysfunc(unicode(\u2192))" '.'
4 / 'Here is another arrow ' 'E28692'x '.'
5 ;
6 run;
Here is an arrow →.
Here is another arrow →.
NOTE: DATA statement used (Total process time):
real time 0.35 seconds
cpu time 0.01 seconds
7
8 data _null_;
9 putlog 'Next step.' ;
10 run;
Next step.
^L2 The SAS System 17:42 Monday, February 5, 2018
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
11
ERROR: An exception has been encountered.
Please contact technical support and provide them with the following traceback information:
The SAS task name is [DATASTEP]
Segmentation Violation
Traceback of the Exception:
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/sasexe/sas(+0x15aa8e) [0x2afdf8bdca8e]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/sasexe/sas(+0x4cb0b) [0x2afdf8aceb0b]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/sasexe/tkmk.so(bkt_signal_handler+0x144) [0x2afdfa2193c4]
/lib64/libpthread.so.0(+0x389e40f790) [0x2afdf9185790]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/sasexe/uwuunico(unicget+0xb3) [0x2afe2aeff343]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/sasexe/sasxfnc(yfxfn+0x1ff) [0x2afe28c9d69f]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/dbcs/sasexe/sasxmac(yjsysf+0xe74) [0x2afe1db084d4]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/dbcs/sasexe/sasxmac(yjoch+0x2c55) [0x2afe1db195d5]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/dbcs/sasexe/sasxshel(ytscan+0x2543) [0x2afe0b2886d3]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/dbcs/sasexe/sasxshel(yjdelta+0x33) [0x2afe0b26e183]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/dbcs/sasexe/sasxshel(yjnext+0x95) [0x2afe0b2724d5]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/dbcs/sasexe/sasxshel(ytokap+0x6a) [0x2afe0b27fb0a]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/dbcs/sasexe/sasxshel(yttknx+0x32c0) [0x2afe0b27f2a0]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/sasexe/sasdsc(dsctok+0x26) [0x2afe2a50ce76]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/dbcs/sasexe/sasxshel(ysprstm+0x523) [0x2afe0b295b93]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/sasexe/sasdsc(dsccomp+0x198) [0x2afe2a4ea428]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/sasexe/sasds(sasds+0x1a7) [0x2afe299ffd47]
/Volumes/app/sas/test/sas9.4/SASFoundation/9.4/sasexe/sas(vvtentr+0x13d) [0x2afdf8ace6ad]
/lib64/libpthread.so.0(+0x389e407a51) [0x2afdf917da51]
/lib64/libc.so.6(clone+0x6d) [0x2afdf9b3b93d]
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
NOTE: The SAS System stopped processing this step because of errors.
12 data _null_;
13 putlog 'Here is an arrow ' "%sysfunc(unicode(\u2192))" '.'
14 / 'Here is another arrow ' 'E28692'x '.'
15 ;
16 run;
17
18 data _null_;
19 putlog 'Next step.' ;
20 run;
Next step.
NOTE: DATA statement used (Total process time):