<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SASEGScripting.dll can't connect to server in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/531688#M32950</link>
    <description>&lt;P&gt;Willian has opened one track in Brazil's TS and I've asked for the log Chris mentioned.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;But, he could solve his problem by himself (I think he used something like SFTTRAY.EXE to use the CMD of the machine which has SAS E.G. installed).&lt;BR /&gt;&lt;BR /&gt;Accessing this machine, he could automate what he was looking for.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I believe he will post his final solution here.&lt;/P&gt;</description>
    <pubDate>Thu, 31 Jan 2019 16:15:41 GMT</pubDate>
    <dc:creator>cepmiranda</dc:creator>
    <dc:date>2019-01-31T16:15:41Z</dc:date>
    <item>
      <title>SASEGScripting.dll can't connect to server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/528743#M32895</link>
      <description>&lt;P&gt;I have a SAS EG project with a set SAS_GRID profile. I'm trying to automate it by using&amp;nbsp;SASEGScripting.dll and vbscript. With the dll I'm able to open a project, edit it, save it etc., however it won't connect to the grid.&amp;nbsp;Can someone help please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even if I previously open my project manually, set a profile, do a test run and save, the dll asks for credentials (already defeats the purpose of automation):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error1.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26396iAE0390209F225E23/image-size/large?v=v2&amp;amp;px=999" role="button" title="error1.JPG" alt="error1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Worse yet, even if I write my correct credentials, it doesn't work:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error2.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26397i27E88D01E17F90C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="error2.JPG" alt="error2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my vbscript&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim objApp, objProject

Set objApp = WScript.CreateObject("SASEGObjectModel.Application.7.1")
WScript.Echo objApp.Name &amp;amp; ", Version: " &amp;amp; objApp.Version

Set objProject = objApp.Open("C:\xxx\xxx.egp","")
objProject.Run
objProject.Save

objProject.Close
objApp.Quit&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 12:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/528743#M32895</guid>
      <dc:creator>willrazen</dc:creator>
      <dc:date>2019-01-21T12:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting.dll can't connect to server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/528753#M32896</link>
      <description>&lt;P&gt;During an automation run, the process needs access to your credentials. If they aren't cached in your profile, you need to stage them in a special credentials.xml file.&amp;nbsp; &lt;A href="http://support.sas.com/kb/30/917.html" target="_self"&gt;See this SAS Note for details&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 13:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/528753#M32896</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-01-21T13:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting.dll can't connect to server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/528867#M32897</link>
      <description>&lt;P&gt;Hi Chris, thanks for your input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried following the instructions, however it still didn't work. I created a credentials.xml&amp;nbsp;like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;xml FileVersion="7.1"&amp;gt;
	&amp;lt;credentials&amp;gt;
		&amp;lt;server name="SASApp_xxx" userid="xxx" password="xxx"/&amp;gt;
	&amp;lt;/credentials&amp;gt;
&amp;lt;/xml&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I tested putting it in various folders, but none worked:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Same folder as&amp;nbsp;SASEGScripting.dll&lt;/LI&gt;&lt;LI&gt;%appdata%\Roaming\SAS\SharedSettings\7.1&lt;/LI&gt;&lt;LI&gt;%appdata%\Roaming\SAS\SharedSettings\7.1\Engine&lt;/LI&gt;&lt;LI&gt;%appdata%\Roaming\SAS\EnterpriseGuide\7.1&lt;/LI&gt;&lt;LI&gt;%appdata%\Roaming\SAS\MetadataServerProfiles&lt;/LI&gt;&lt;LI&gt;%appdata%\Local\SAS\SASDeploymentWizard&lt;/LI&gt;&lt;LI&gt;%allusersprofile%\SAS\SharedSettings\7.1&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Only folder %appdata%\Roaming\SAS\SharedSettings\7.1 showed any change in behavior: the credential pop-up stopped showing and I got "unable to connect to server" message instantaneously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe I need to change something in&amp;nbsp;ConfigurationV71.xml file located in &lt;SPAN&gt;MetadataServerProfiles folder&lt;/SPAN&gt;? It is currently like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;Configuration LastWrittenBy="Engine Configuration Manager" FileVersion="2"&amp;gt;
  &amp;lt;Profiles /&amp;gt;
  &amp;lt;Settings&amp;gt;
    &amp;lt;ActiveProfile&amp;gt;Null Provider&amp;lt;/ActiveProfile&amp;gt;
    &amp;lt;GenerateLocalServer&amp;gt;False&amp;lt;/GenerateLocalServer&amp;gt;
  &amp;lt;/Settings&amp;gt;
&amp;lt;/Configuration&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 19:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/528867#M32897</guid>
      <dc:creator>willrazen</dc:creator>
      <dc:date>2019-01-21T19:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting.dll can't connect to server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/528910#M32898</link>
      <description>&lt;P&gt;I suggest that you turn on Application Logging (Tools-&amp;gt;Options) and try again.&amp;nbsp; This will generate a CSCRIPT.exe.log file in your app profile directory and that might contain some helpful details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you might need to work with SAS Tech Support to help diagnose -- the TS consultants help folks with EG automation questions all of the time.&amp;nbsp; It can be a tricky topic.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 21:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/528910#M32898</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-01-21T21:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting.dll can't connect to server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/531688#M32950</link>
      <description>&lt;P&gt;Willian has opened one track in Brazil's TS and I've asked for the log Chris mentioned.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;But, he could solve his problem by himself (I think he used something like SFTTRAY.EXE to use the CMD of the machine which has SAS E.G. installed).&lt;BR /&gt;&lt;BR /&gt;Accessing this machine, he could automate what he was looking for.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I believe he will post his final solution here.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 16:15:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/531688#M32950</guid>
      <dc:creator>cepmiranda</dc:creator>
      <dc:date>2019-01-31T16:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting.dll can't connect to server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/531774#M32951</link>
      <description>&lt;P&gt;There was one element about the problem that makes it more difficult: Willian are using SAS E.G. with App-v.&lt;BR /&gt;&lt;BR /&gt;He shares his solution for this moment (below is my understanding of his 'solution'):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;**********;&lt;/P&gt;
&lt;P&gt;Use Python's scheduler to run Windows' client (end user's machine) commands and, with this commands, access the SAS E.G.'s machine CMD. There, he can run his *.vbs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;He don't think it is perfect because he can't logoff. But he seems to be happy it is working for now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;He shares:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Open prompt within the SAS App-V environment (bubble) changing PackageId and VersionId by AppxManifest.xml values:&lt;/P&gt;
&lt;P&gt;cmd.exe /appvve:PackageId_VersionId&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Once you are in the correct machine, run your *.vbs:&lt;/P&gt;
&lt;P&gt;c:\windows\syswow64\cscript run_sas.vbs&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;**********;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 19:16:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/531774#M32951</guid>
      <dc:creator>cepmiranda</dc:creator>
      <dc:date>2019-01-31T19:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting.dll can't connect to server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/532595#M32971</link>
      <description>&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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 -&amp;gt; Test SAS Servers -&amp;gt; Next -&amp;gt; Specify which metadata configuration files to use -&amp;gt; "..." -&amp;gt; %appdata%\SAS\MetadataServerProfiles -&amp;gt; Right click&amp;nbsp;ConfigurationV71.xml -&amp;gt; Edit -&amp;gt; Make your changes -&amp;gt; Save -&amp;gt; Close everything&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;Configuration LastWrittenBy="Engine Configuration Manager" FileVersion="2"&amp;gt;
  &amp;lt;Profiles&amp;gt;
    &amp;lt;Profile&amp;gt;
      &amp;lt;Name&amp;gt;...&amp;lt;/Name&amp;gt;
      &amp;lt;Description /&amp;gt;
      &amp;lt;Type&amp;gt;OMS&amp;lt;/Type&amp;gt;
      &amp;lt;Hosts&amp;gt;
        &amp;lt;Host machine="..." port="..." /&amp;gt;
      &amp;lt;/Hosts&amp;gt;
      &amp;lt;UseIWA&amp;gt;False&amp;lt;/UseIWA&amp;gt;
      &amp;lt;SaveLogin&amp;gt;True&amp;lt;/SaveLogin&amp;gt;
      &amp;lt;User&amp;gt;...&amp;lt;/User&amp;gt;
      &amp;lt;Password&amp;gt;...&amp;lt;/Password&amp;gt;
      &amp;lt;DefaultServer&amp;gt;...&amp;lt;/DefaultServer&amp;gt;
    &amp;lt;/Profile&amp;gt;
  &amp;lt;/Profiles&amp;gt;
  &amp;lt;Settings&amp;gt;
    &amp;lt;ActiveProfile&amp;gt;...&amp;lt;/ActiveProfile&amp;gt;
    &amp;lt;GenerateLocalServer&amp;gt;False&amp;lt;/GenerateLocalServer&amp;gt;
  &amp;lt;/Settings&amp;gt;
&amp;lt;/Configuration&amp;gt;&lt;/PRE&gt;&lt;P&gt;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&amp;nbsp;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)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;cmd.exe /appvve:PackageID_VersionID&lt;/PRE&gt;&lt;P&gt;3. From this prompt, run your SAS automation vbscript by calling the correct cscript version (in my case 32bit SAS in 64bit machine)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;c:\windows\syswow64\cscript run_sas.vbs&lt;/PRE&gt;&lt;P&gt;4. Here's an example of vbscript based on Chris' excellent paper&amp;nbsp;Not Just for Scheduling: Doing More with SAS® Enterprise Guide® Automation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;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 &amp;amp; ", Version: " &amp;amp; objApp.Version

'Check profiles
Set oShell = CreateObject( "WScript.Shell" )
WScript.Echo "Metadata profiles available for " _ 
	&amp;amp; oShell.ExpandEnvironmentStrings("%UserName%")
WScript.Echo "----------------------------------------"
For i = 1 to objApp.Profiles.Count-1
	WScript.Echo "Profile available: " _ 
	&amp;amp; objApp.Profiles.Item(i).Name _ 
	&amp;amp; ", Host: " _ 
	&amp;amp; objApp.Profiles.Item(i).HostName _ 
	&amp;amp; ", Port: " _ 
	&amp;amp; 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)&amp;lt;0.85; run;"
objProgram.Server = "..."
objProgram.Text = objProgram.Text &amp;amp; " proc means; run;"
objProgram.Run
objProgram.Log.SaveAs outDir &amp;amp; "\sas.log"
For n=0 to (objProgram.OutputDatasets.Count -1)
	Dim dataName
	dataName = objProgram.OutputDatasets.Item(n).Name
	objProgram.OutputDatasets.Item(n).SaveAs outDir &amp;amp; "\" &amp;amp; dataName &amp;amp; ".xlsx"
Next

'Close SAS
objApp.Quit&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Feb 2019 15:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-dll-can-t-connect-to-server/m-p/532595#M32971</guid>
      <dc:creator>willrazen</dc:creator>
      <dc:date>2019-02-04T15:45:04Z</dc:date>
    </item>
  </channel>
</rss>

