BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
blueskyxyz
Lapis Lazuli | Level 10

Hi guys,

 

1. how to add submit with sas 9.4 chinese on windows system when right-clicking on sas code (*.sas)?

 there are two default options(sas9.4 and sas9.4 utf8) when you do right mouse click as below.

since the sasv9.cfg uses u8 configration under the path C:\Program Files\SASHome\SASFoundation\9.4, like this  -config "C:\Program Files\SASHome\SASFoundation\9.4\nls\u8\sasv9.cfg 

blueskyxyz_0-1655801742469.png

 

2. how modify the dos script to run sas xx.sas with the chinese sasv9.cfg

refence link :https://sites.psu.edu/pridmc/running-sas-from-command-prompt-running-multiple-sas-jobs/

From a DOS prompt, you can do this to run ‘programname.sas’:

	sasjob programname.sas  with sasv9.cfg

since there are two different encodings(utf8  & chinese) for datasets in different projects

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12

There is a way to summarize the options with set, which is essentially the same, but may be more efficient if you have a number of programs to run (i.e., if you write many lines).

 

For example.

set sasoptions=-rsasuser -noicon -nosplash -nostatuswin -nologo
"%SASLOC%\sas.exe" "%PRJLOC%\T_1_01.SAS" -config "%sascfg%" %sasoptions%
"%SASLOC%\sas.exe" "%PRJLOC%\T_1_02.SAS" -config "%sascfg%" %sasoptions%
"%SASLOC%\sas.exe" "%PRJLOC%\T_1_03.SAS" -config "%sascfg%" %sasoptions%

Why not just go ahead and put everything together from the exe path to the options using set?

set sasexec="%SASLOC%\sas.exe" -rsasuser -noicon -nosplash -nostatuswin -nologo -config "%sascfg%"
%sasexec% -sysin "%PRJLOC%\T_1_01.SAS"
%sasexec% -sysin "%PRJLOC%\T_1_02.SAS"
%sasexec% -sysin "%PRJLOC%\T_1_03.SAS"

View solution in original post

7 REPLIES 7
blueskyxyz
Lapis Lazuli | Level 10
"%SASLOC%\sas.exe" -rsasuser -noicon -nosplash -nostatuswin -nologo -config "%sascfg%" -SYSIN "%PRJLOC%\T_1_01.SAS"

this is too long for batch sumbit with sas 9.4 chinese, is there any efficient way?
japelin
Rhodochrosite | Level 12

1.

Create regfile as below.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\SAS.Program.701\shell\BatchZh]
@="Batch Submit with SAS 9.4(Simplified Chinese)"

[HKEY_CLASSES_ROOT\SAS.Program.701\shell\BatchZh\command]
@="\"C:\\Program Files\\SASHome\\SASFoundation\\9.4\\sas.exe\" \"%1\" -nologo -config  \"C:\\Program Files\\SASHome\\SASFoundation\\9.4\\nls\\zh\\SASV9.CFG\""

Then run and add to registry.

Please check sas.exe path and config path before run.

 

you can get batch submit by sas chinese.

japelin_1-1655808593951.png

 

 

2.You can omit -sysin by writing .sas immediately after sas.exe like this.

"%SASLOC%\sas.exe" "%PRJLOC%\T_1_01.SAS" -rsasuser -noicon -nosplash -nostatuswin -nologo -config "%sascfg%" 

I think  basically there is no more efficient way.

 

blueskyxyz
Lapis Lazuli | Level 10

C:\Program Files\SASHome\SASFoundation\9.4\nls\zh\sasv9.cfg

blueskyxyz_0-1655861188006.png

@japelin Morning,  japelin, thanks your help , you sovle the first question

  I want to see if someone could sort another question out

 

japelin
Rhodochrosite | Level 12

There is a way to summarize the options with set, which is essentially the same, but may be more efficient if you have a number of programs to run (i.e., if you write many lines).

 

For example.

set sasoptions=-rsasuser -noicon -nosplash -nostatuswin -nologo
"%SASLOC%\sas.exe" "%PRJLOC%\T_1_01.SAS" -config "%sascfg%" %sasoptions%
"%SASLOC%\sas.exe" "%PRJLOC%\T_1_02.SAS" -config "%sascfg%" %sasoptions%
"%SASLOC%\sas.exe" "%PRJLOC%\T_1_03.SAS" -config "%sascfg%" %sasoptions%

Why not just go ahead and put everything together from the exe path to the options using set?

set sasexec="%SASLOC%\sas.exe" -rsasuser -noicon -nosplash -nostatuswin -nologo -config "%sascfg%"
%sasexec% -sysin "%PRJLOC%\T_1_01.SAS"
%sasexec% -sysin "%PRJLOC%\T_1_02.SAS"
%sasexec% -sysin "%PRJLOC%\T_1_03.SAS"
blueskyxyz
Lapis Lazuli | Level 10

blueskyxyz_0-1655864470936.png

1.use the value of batch command,  copy them and create *.bat file, put this file under c:\windows

blueskyxyz_1-1655864617329.png

2. run the code , like sasu8 xx.sas under the path of sas program

blueskyxyz_4-1655864835024.png

 

 

 

japelin
Rhodochrosite | Level 12

C:\Windows is the system folder, so you should not put user-created .bat.
If such an operational rule is set, it is unavoidable, but if it is a personal arrangement, I recommend using under %userprofile% ,for example, documents, My SAS Files, %appdata% or created folder, etc.

 

blueskyxyz
Lapis Lazuli | Level 10
thanks @ japelin for your remind, I will try your recommendation and put it in the personal folder

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 2138 views
  • 2 likes
  • 2 in conversation