Chris and Carlos, thanks a lot for your help. As Carlos said, I eventually was able to solve my problem without needing admin rights or difficult workarounds, here's a step by step for whom might need this in the future: 1. Go to %appdata%\SAS\MetadataServerProfiles folder and make sure your profile is registered in ConfigurationV71.xml as below (replace ... by your values). Obs: If this doesn't work, it is possible that App-V is hiding the correct file, in this case a workaround is to run ITConfig2.exe -> Test SAS Servers -> Next -> Specify which metadata configuration files to use -> "..." -> %appdata%\SAS\MetadataServerProfiles -> Right click ConfigurationV71.xml -> Edit -> Make your changes -> Save -> Close everything <?xml version="1.0" encoding="utf-8"?>
<Configuration LastWrittenBy="Engine Configuration Manager" FileVersion="2">
<Profiles>
<Profile>
<Name>...</Name>
<Description />
<Type>OMS</Type>
<Hosts>
<Host machine="..." port="..." />
</Hosts>
<UseIWA>False</UseIWA>
<SaveLogin>True</SaveLogin>
<User>...</User>
<Password>...</Password>
<DefaultServer>...</DefaultServer>
</Profile>
</Profiles>
<Settings>
<ActiveProfile>...</ActiveProfile>
<GenerateLocalServer>False</GenerateLocalServer>
</Settings>
</Configuration> 2. From your automation script/service, launch a command prompt inside the App-V bubble (replace PackageID and VersionID with the values you find inside AppxManifest.xml, you can find this file in the root folder of your App-V app, an easy way to find the path is to follow the shortcut to SAS EG) cmd.exe /appvve:PackageID_VersionID 3. From this prompt, run your SAS automation vbscript by calling the correct cscript version (in my case 32bit SAS in 64bit machine) c:\windows\syswow64\cscript run_sas.vbs 4. Here's an example of vbscript based on Chris' excellent paper Not Just for Scheduling: Doing More with SAS® Enterprise Guide® Automation Dim objShell, objApp, objProject, objProgram
Dim i, n
'Parameters
outDir = "C:\out"
'Load SAS
Set objApp = WScript.CreateObject("SASEGObjectModel.Application.7.1")
WScript.Echo objApp.Name & ", Version: " & objApp.Version
'Check profiles
Set oShell = CreateObject( "WScript.Shell" )
WScript.Echo "Metadata profiles available for " _
& oShell.ExpandEnvironmentStrings("%UserName%")
WScript.Echo "----------------------------------------"
For i = 1 to objApp.Profiles.Count-1
WScript.Echo "Profile available: " _
& objApp.Profiles.Item(i).Name _
& ", Host: " _
& objApp.Profiles.Item(i).HostName _
& ", Port: " _
& objApp.Profiles.Item(i).Port
Next
'Test creating a project, running a program, and saving outputs
objApp.SetActiveProfile("...")
Set objProject = objApp.New
Set objProgram = objProject.CodeCollection.Add
objProgram.UseApplicationOptions = False
objProgram.GenSasReport = False
objProgram.Text = "data work.cars; set sashelp.cars; if ranuni(0)<0.85; run;"
objProgram.Server = "..."
objProgram.Text = objProgram.Text & " proc means; run;"
objProgram.Run
objProgram.Log.SaveAs outDir & "\sas.log"
For n=0 to (objProgram.OutputDatasets.Count -1)
Dim dataName
dataName = objProgram.OutputDatasets.Item(n).Name
objProgram.OutputDatasets.Item(n).SaveAs outDir & "\" & dataName & ".xlsx"
Next
'Close SAS
objApp.Quit
... View more