You must set the environment variables in the SAS startup script, not in a separate cmd window.
This is what @Kurt_Bremser was talking about
1.Create a Windows batch script in a desired directory (pyfromsas.bat)
2.Inside that pyfromsas.bat file, add the following lines
REM echo off
set MAS_M2PATH=<C:\Program Files\SASHome\SASFoundation\9.4>\tkmas\sasmisc\mas2py.py
set MAS_PYPATH=C:\<InstallationPath>\python.exe
"<C:\Program Files\SASHome\SASFoundation\9.4>\sas.exe" -CONFIG "<C:\Program Files\SASHome\SASFoundation\9.4>\nls\en\sasv9.cfg“
3.Save the pyfromsas.bat
4.Run the script
C:\> <path>\pyfromsas.bat
Note: Change the <C:\Program Files\SASHome\SASFoundation\9.4> to match the installation directory of the SAS software on your machine.
Hope this helps,
Ahmed
Thanks Ahmed, I will try out your suggestions soon. I had some questions though -
1.
When you say : 1.Create a Windows batch script in a desired directory (pyfromsas.bat) - what is this desired directory? Where do I put the pyfromsas.bat file? Does it matter or can it be anywhere?
2. When you say:
Change the <C:\Program Files\SASHome\SASFoundation\9.4>to match the installation directory of the SAS software on your machine. :\Program Files\SASHome\SASFoundation\9.4 actually is part of the installation path, because my version of SAS9.4 has been installed locally on my own laptop. So I don't need to change that, do I?
Here is where Windos search bar locates SAS on my laptop:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\SAS
Thank you
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.