I need to use Chinese version SAS to create Chinese SASplots and want to reproduce chinese plot using LAtex Statrep package.
However Statrep can only work when run with Unicode Version SAS.exe without chinese zh\sasv9.cfg.
Do anyone know how to make statrep work with chinese version SAS?
http://support.sas.com/rnd/app/papers/statrep.html
The quickstart_SR.sas can run correctly in SAS unicode edition but when in SAS chinese edition, it will look like the picture.
Just as Warren pointed out, your codes fail to run for the "Graph" has been translated. You need to modify statrep_macros.sas to correct it, then run below code:
options validvarname=any; /* enable to support variables with Chinese characters */
%inc "C:\Public\statrep\doc\quickstart_SR.sas";
Please refer to attached statrep_macros.sas
You will have to edit the write macro that comes with the package to incorporate the Chinese version of "Graph" or "Graphic" that it uses. Not all of SAS output should be translated. I suspect someone translated the graph type. I don't have any access to SAS code since I retired to look into it myself, but I will pass this on.
Just as Warren pointed out, your codes fail to run for the "Graph" has been translated. You need to modify statrep_macros.sas to correct it, then run below code:
options validvarname=any; /* enable to support variables with Chinese characters */
%inc "C:\Public\statrep\doc\quickstart_SR.sas";
Please refer to attached statrep_macros.sas
Thank you so much.
In order for it to fully work, Could you please help me again to make .lst file UTF8 by modifying macro file?
I cannot use \UseRawInputEncoding for Latex , since chinese version latex need [UTF8]
Sadly, after I changed .lst file's unicode by hand, the page is still a litte off.
I believe it will be latex statrep package's problem.
If you could help with this problem too, I will be very appreciated.
But anyway, Thank so much for helping so far.
I assumed that you can run unicode version of SAS, but it run against en_US locale. If so, the easist way to correct your issue is to change locale from en_US to zh_CN in nls/u8/sasv9.cfg (find -LOCALE en_US, then change en_US to zh_CN), which make sure all your outputs are in Chinese except your GUI. You also need to use the new attached utf-8 version of statrep_macros.sas.
Sorry I am not familiar with Latex, so I cannot confirm if my way works.
Thank you so much for helping. Unfortunately, SAS unicode(with chinese locale) will make my table display awkward character since there are chinese character in my original SAS program.
I tried to put encoding="utf8 " in output lst (macro write file in statrep macro in order to make it work.
However it does not work. I do not know if it is due to I put encoding=utf at wrong place .
It look like this
filename __f1 "&listingdir/_tmp" encoding="utf8";
Thank you so much for creating statrep package and helping.
There is just one last problem that I have no idea how to solve.
The chinese .lst file look so awkward. and I believe it need to do with statrep latex package.
Could you please help me or point me to the right direction?
Thank you again.
You can run below code to change the default linesize.
proc options option=ls;run;
Please try to change to linesize to a proper value, such as, 127 with below code.
options ls=127;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.