BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mengxibai6
Fluorite | Level 6

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.

UU%OG46_F_J(}J([0X4}891.png

1 ACCEPTED SOLUTION

Accepted Solutions
sbjwhl
SAS Employee

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

View solution in original post

7 REPLIES 7
WarrenKuhfeld
Rhodochrosite | Level 12

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.

 

sbjwhl
SAS Employee

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

mengxibai6
Fluorite | Level 6

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]

 

1pture.PNGre.PNG

Sadly, after I changed .lst file's unicode by hand, the page is still a litte off.

C.PNG

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. 

 

 

sbjwhl
SAS Employee

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.

mengxibai6
Fluorite | Level 6

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";

 

mengxibai6
Fluorite | Level 6

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?

help.PNG

Thank you again. 

sbjwhl
SAS Employee

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;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to connect to databases in SAS Viya

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.

Discussion stats
  • 7 replies
  • 1568 views
  • 4 likes
  • 3 in conversation