Hemken / SASmarkdown

A collection of R functions that extends knitr's capability for using SAS as a language engine
Other
21 stars 5 forks source link

Can SASmarkdown use SAS chinese version? #7

Closed mengxibai closed 5 years ago

mengxibai commented 5 years ago

my dataset contain chinese characters which are necessary I have SAS chinese version but when I use {r, engine="sas",saspath="sas.exe"} it always opens SAS english. I cannot run Chinese datafile in pure SAS.exe. SAS chinese open like "C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\zh\sasv9.cfg"

Hemken commented 5 years ago

You should use this setup

library(SASmarkdown)
sasexe <- find_sas()
sasopts <- “-nosplash – ls 75 -config ‘C:\Program Files\SASHome\SASFoundation\9.4\nls\zh\sasv9.cfg’ ”
knitr::opts_chunk$set(engine.path=list(sas=sasexe, saslog=sasexe),
                      engine.opts=list(sas=sasopts, saslog=sasopts))

Then for SAS code chunks you can just write

/* your code here */

(note if you copy and paste the code above, you may need to retype the quotes) From: Mengxi Bai notifications@github.com Sent: Friday, April 12, 2019 3:21 AM To: Hemken/SASmarkdown SASmarkdown@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Hemken/SASmarkdown] Can SASmarkdown use SAS chinese version? (#7)

my dataset contain chinese characters which are necessary I have SAS chinese version but when I use {r, engine="sas",saspath="sas.exe"} it always opens SAS english. I cannot run Chinese datafile in pure SAS.exe. SAS chinese open like "C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\zh\sasv9.cfg"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/SASmarkdown/issues/7, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALAWE08uXvmjBgXz-tr7BYcxEGbEOVB8ks5vgEHUgaJpZM4crldJ.

Hemken commented 5 years ago

It looks like those need to be forward slashes:

sasexe <- find_sas() 
sasopts <- “-nosplash – ls 75 -config ‘C:/Program Files/SASHome/SASFoundation/9.4/nls/zh/sasv9.cfg’ ” 
knitr::opts_chunk$set(engine.path=list(sas=sasexe, saslog=sasexe), engine.opts=list(sas=sasopts, saslog=sasopts)) 
mengxibai commented 5 years ago

It looks like those need to be forward slashes:

sasexe <- find_sas() 
sasopts <- “-nosplash – ls 75 -config ‘C:/Program Files/SASHome/SASFoundation/9.4/nls/zh/sasv9.cfg’ ” 
knitr::opts_chunk$set(engine.path=list(sas=sasexe, saslog=sasexe), engine.opts=list(sas=sasopts, saslog=sasopts)) 

Thank you so much. It work perfectly.!!!!!